regex - regular expression in Perl to excluded patterns but include pattern -


i want have regex pattern match line:
1.this line must contain word "s200"
2. end of string cannot "sping","js","json","css"

here monster got,which doesn't work

(?=^.*$(?<!sping)(?<!js)(?<!css)(?<!json))(?=s200)

i new regex, aapreciated!

you have tagged perl, here's perl solution:

$_ = $stringtotest; if (/s200/) {     # know string contains "s200"     if (/sping|json|js|css$/) {         # know end 1 of sping,json,js or css     } } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -