[英]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" 嗨,我正在尝试做一个让我烦恼的简单正则表达式,因为它应该很容易-我使用的是notepad ++,并且可能“以不同方式”进行过滤
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
我想在字符串
id=0&name=/1274-IMG_2919.JPG
通配符id=0&name=/1274-IMG_2919.JPG
的位,以便在替换1274-IMG_2919
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; 您正在寻找带有
-
和_
的字符串,但它们不是您定义的字符集的一部分: [a-zA-Z0-9]
,这对我[a-zA-Z0-9]
;
\&name\=\/([a-zA-Z0-9\-_]+)\.JPG
(or briefer &name=\\/([\\w\\-]+)\\.JPG
) (或更简短的
&name=\\/([\\w\\-]+)\\.JPG
ww- &name=\\/([\\w\\-]+)\\.JPG
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.