I need to match exactly two bytes for anything other than \x00\x00.
Is it possible to do it without using negative lookahead? (The Regex engine I use doesn't allow me to)
So as an example:
\x00\x00isn't valid\x30\x31is valid
Thanks
I need to match exactly two bytes for anything other than \x00\x00.
Is it possible to do it without using negative lookahead? (The Regex engine I use doesn't allow me to)
So as an example:
\x00\x00 isn't valid\x30\x31 is validThanks
I need to match exactly two bytes for anything other than
\x00\x00
You may use this regex with 2 negated characters classes and an alternation:
^[^\x00]|[^\x00]$
RegEx Explained:
^: Start[^\x00]: Match anything except \x00|: OR[^\x00]: Match anything except \x00$: End