Thread: Regex examples
View Single Post
Old 04-16-2014, 11:51 AM   #326
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Quote:
Originally Posted by Jellby View Post
But it would also find it between two <i></i> blocks, wouldn't it?

<i>foo</i> τον <i>bar</i>

Even with non-greedy modifier, the asterisk matches as many as needed to make the whole pattern match.
You are absolutely right!

BTW: Mine expression also isn't fool-proof as it would wrongly handle invalid HTML:

<i>foo</i> τον bar</i>
Skeeve is offline   Reply With Quote