I would like to match any one of these characters: <
or >
or <=
or >=
or =
.
This one doe
You don't need to escape any of those characters in character class. Apart from that, you need to use quantifiers, to match more than 1 repetition of those characters.
You need this:
[<>=]{1,2}
Note the quantifier, to match 2 repetitions, as required for <=
and >=
.
Also, note that this will also match - ==
, <<
. If you strictly want to match just those 4 strings, you can use this regex:
[<>]=?|=
Using ?
after =
makes it optional. So, first part will match - <
, >
, <=
, and >=
. And then we add =
using pipe.