conners
conners

Reputation: 1420

regex wildcard find and replace notepad++

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

Answers (1)

Alex K.
Alex K.

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

Related Questions