How do you match only equal numbers of the same character (up to 3) on each side of a string in python?
For example, let’s say I am trying to match equal signs
=abc= or ==abc== or ===abc===
but not
=abc== or ==abc=
etc.
I figured out how to do each individual case, but can’t seem to get all of them.
(={1}(?=abc={1}))abc(={1})
as | of the same character
((={1}(?=abc={1}))|(={2}(?=abc={2})))abc(={1}|={2})
doesn’t seem to work.
Use the following regex:
Edit:
If you are talking about only max three
=