Suppose I have the following regex in grep
:
grep -E 'head \x1E tail'
I can make grep
aware of non-ascii characters using its personal escape code, \x
.
Can I do the same with Bash, without calling any external program? Bash provides 3 modes for matching regexes:
- plain pathname expansion
- extglob pathname expansion
- [[ string =~ regex ]]
None of these appears to support UTF escape codes, nor Bash itself.