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
精彩评论