I'm trying to write a regex for golang that matches a string that doesn't end with @abcdefghijk.com. Is this possible? Golang doesn't support negative lookaheads.
Basically the equivalent of:
^(?!.*@abcdefghijk\.com$)
I'm trying to write a regex for golang that matches a string that doesn't end with @abcdefghijk.com. Is this possible? Golang doesn't support negative lookaheads.
Basically the equivalent of:
^(?!.*@abcdefghijk\.com$)
A regex not ending with @abcdefghijk.com
for POSIX is
^(.*([^@].{15}|.[^a].{14}|.{2}[^b].{13}|.{3}[^c].{12}|.{4}[^d].{11}|.{5}[^e].{10}|.{6}[^f]).{9}|.{7}[^g].{8}|.{8}[^h].{7}|.{9}[^i].{6}|.{10}[^j].{5}|.{11}[^k].{4}|.{12}[^.].{3}|.{13}[^c].{2}|.{14}[^o].|.{15}[^m]|.{0,15})$
See Regex: match everything but a specific pattern for details (scroll to "a string ending with a specific pattern" and see the POSIX workaround).
See the regex demo.