开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜