Link to home
Start Free TrialLog in
Avatar of daisydoos
daisydoos

asked on

Javascript regex

Hi,

I want to match everything in this string from "sort" to the ampersand but not including it

var string = "somedomain.com?sort=prod.name_asc&rowspp=10";

the regex I'm using is /sort=(.*?)[^&]*/g

This works, but it doesn't in Javascript ...

Many thanks!
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial