regex - Find Two Words on url string -


i'm trying find 2 words on urls, looks underscore don't allow word found

http://www.example.com/image/med_crop/photo.jpg

http://www.example.com/image/medium/photo.jpg

/\bmedium\b|\wmed_crop\w/i 

http://regex101.com/r/wi5of7/1

why use \w around "med_crop". \w matches [a-za-z0-9_], not slashes. also, need use global modifier g if want match more 1 @ time.

this seems work in example

/\bmedium\b|\bmed_crop\b/ig 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -