libc: regex: factor out ISBOW/ISEOW macros
These will be reused for \b (word boundary, which matches both sides).
No functional change.