Question: I have a series of strings like this:

```
http://mytestdomain.com/bla/abc/?zde&wpv_paged=2
http://mytestdomain.com/bla/abc/?zde&wpv_paged=3
http://mytestdomain.com/bla/abc/?zde&wpv_paged=4
http://mytestdomain.com/bla/abc/?zde&wpv_paged=5

```

etc

I need a way to remove the `'&wpv_paged='` part of the string as well as everything after it

My question is, should I use `regex` or `split()` for this and if so, how would I achieve this?

Thanks

Answer: 
```
&wpv_paged=\d+.*$

```

You can try this.Replace with `empty string`.See demo.

<http://regex101.com/r/sU3fA2/7>
Depending on what you want for `http://mytestdomain.com/bla/abc/?zde&wpv_paged=2&param2=abc`

```
"http://mytestdomain.com/bla/abc/?zde&wpv_paged=2&param2=abc".split("&wpv_")[0]

```

gives:

```
http://mytestdomain.com/bla/abc/?zde

```

and

```
"http://mytestdomain.com/bla/abc/?zde&wpv_paged=2&param2=abc".replace(/&wpv_paged=\d+/, '')

```

gives:

```
http://mytestdomain.com/bla/abc/?zde&param2=abc

```