Hi I am trying to do a simple regex that is annoying me because it should be easy - I am using notepad++ and that might be filtering "differently"
here is what I have
I want to find inside the string id=0&name=/1274-IMG_2919.JPG
the bit that is the wildcard 1274-IMG_2919
so that it becomes after it's replaced id=0&name=/1274-IMG_2919.JPG -O 1274-IMG_2919.JPG
here is what I have and it doesn't work
FIND: \&name\=\/([a-zA-Z0-9]+)\.JPG
REPLACE: &name=/$1.JPG -O $1.JPG
Your looking for a string with -
and _
but they are not part of the character set you define: [a-zA-Z0-9]
, this works for me;
\&name\=\/([a-zA-Z0-9\-_]+)\.JPG
(or briefer &name=\\/([\\w\\-]+)\\.JPG
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.