I have tried to match <b>
using regular expressions.
the pattern /<.>/
matches <b>
but the pattern /<[.]>/
does not match.
What is the difference between /<.>/
and /<[.]>/
in regular expressions
I have tried to match <b>
using regular expressions.
the pattern /<.>/
matches <b>
but the pattern /<[.]>/
does not match.
What is the difference between /<.>/
and /<[.]>/
in regular expressions
When you put dot inside []
it is a literal dot, not a any character.
So the /<[.]>/
matches only <.>
. It is the same as escaping a dot: \.
in regexp.