News for hackers. Stuff that matters.
Re:Calculate the difference and intersection of any two regexes by o11c on Monday September 11, 2023 @03:56PM (#37472774)
A lack of `^` is equivalent to prepending `(.*)`, then trimming the match span to the end of that capture. And similarly for a lack of `$` (but suddenly I remember how nasty Python was before `.fullmatch` was added ...).

More interesting is word boundaries:

`\b` is just `\<|\>` though that should be bubbled up and usually only one side will actually produce a matchable regex.

`A\<B` is just `(A&\W)(\w&B)`, and similar for `\>`.

Re:Calculate the difference and intersection of any two regexes by o11c on Wednesday September 13, 2023 @06:41PM (#37502649)
Correction, `A\<B` is `(A&(\W|^))(\w&B)`, which matters if the A regex can match the empty string.