开发者

A regex to match a string that is surrounded by %

i need a regex to 开发者_开发知识库find all string that is surrounded by %

example:

A=%Test1% OR B = %Test2% AND (C=%Test3 OR C = %Test4)

what i need are the strings:

%Test1%, %Test2%, %Test3% and %Test4%

thanks.


Just use

%[^%]+%

Which matches a percent sign, followed by a non-zero number of non-percent characters and another percent.


Maybe %[[:alnum::]+% would do the job?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜