-3

I was just going this answer HERE, and i was just playing arouund with the regex in the answer until i reduced one of the regexs to the following:

([^"])

And then i add the below string:

<img src="/sites/ContentCenter/Graphics/map-al.jpg" alt="map al" style="width&#58;611px;height&#58;262px;" />&#160;<br></p><p><br></p><p> 

To check against the above regex , SEE HERE , now the above regex mathces the < of the img tag , why do ? why does ([^"]) match the < in the image tag ? can somebody explain ?

Community
  • 1
  • 1
Alexander Solonik
  • 9,466
  • 17
  • 65
  • 157

1 Answers1

3
([^"])

Is a group (()) of a character from class every-character-except-double-quote so it can match anything except the double quote, even <.

Krzysztof Krasoń
  • 25,163
  • 16
  • 85
  • 109