user5653362
user5653362

Reputation: 161

Regular expression in the URL

I want to exclude everything after categoryId= and the ID. note that the ID will change everytime.

categoryId=46097316&fg=Color&ff=GenericColor&fv=Yellow&fd=Yellow&fg=Color&ff=GenericColor&fv=Ivory&fd=Ivory&fg=Color&ff=GenericColor&fv=Cream&fd=Cream&

I tried categoryId=\d+, but it will delete everything after categoryId=.

Upvotes: 1

Views: 35

Answers (2)

Krzysztof Krasoń
Krzysztof Krasoń

Reputation: 27476

So you want:

categoryId=[^&]+

This assumes you don't know the value type that can by in the categoryId (here it is assumed everything except a &)

Upvotes: 1

m_callens
m_callens

Reputation: 6360

categoryId=(\d+) should do the trick!

Upvotes: 1

Related Questions