I am trying to match all the text from the beginning to the second point, excluding the points that are contained inside the html tags.
The following regexp /^([^\.]*[\.]){0,2}/works fine if they are not HTML tags, as it selects everything from the very beginning to the second point.
However, when I have this:
<p><img src="example.image.com" alt="foo">Text. More text.</p>
I would like my regular expression to stop at the second occurrence of the text, and not at the point between the "image" and the "com".
I also know that I \.(?![^><]*>)will select all the points outside the html tags, but I'm really afraid, and I would really appreciate your help!
source
share