Reputation: 1420
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
Upvotes: 0
Views: 6225
Reputation: 175826
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
)
Upvotes: 3