开发者

How do I write a regexp that stops at a specified string?

开发者 https://www.devze.com 2023-02-01 06:21 出处:网络
I\'m 开发者_运维问答using the java class Pattern to match the strings in a text that start with a specific string, let\'s say abc, that has any text (containing any character) and that stop at the beg

I'm 开发者_运维问答using the java class Pattern to match the strings in a text that start with a specific string, let's say abc, that has any text (containing any character) and that stop at the beginning of another different specified string, let's say def. How would you write this?


Unless your problem is more complicated than you've explained: "abc.*def"


as a side note to your comment, using a regex to proccess html/xml is generally a bad idea. classic explanation here

0

精彩评论

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