regex - perl regular expression -


i having urls in format. urls contain &abc=4 , not.

xxxxxxxxxxxxxxxxxxxxxxxxxxx&abc=4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&abc=4 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

here xxxxxxxxxxxxxxxxxxxxx string

i want match urls have xxxxxxxxxxxxxxxxx , not &abc=4(meaning want these type of urls, xxxxxxxxxxxxxx, xxxxxxxxxxxxxx, xxx)

i know how write regular expression matches entire url. example: /x.*abc=4/

but how write regular expression matches xxxxxxxxxx , not &abc=4?

i use negative look-ahead assertion (look ahead not allowed follow pattern)

^(?!.*&abc=4$).*$ 

this pattern match string not end &abc=4

you can verify online here: http://www.rubular.com/


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -