[Bug 263478] awk: syntax error in regular expression $^
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263478 Bug ID: 263478 Summary: awk: syntax error in regular expression $^ Product: Base System Version: 13.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: b...@freebsd.org Reporter: ke...@kevinlocke.name Using the regular expression $^ as a pattern, for example by running `awk /$^/`, causes the following error: awk: syntax error in regular expression $^ at source line number 1 context is >>> /$^/ <<< As far as I can tell, $^ is a valid Extended Regular Expression,[^1] as expected by awk,[^2] although it is a bit unusual. I encountered the bug in the ident[^3] script used by jscal-save of the Linux Console Project and am not aware of any uses likely to affect FreeBSD users. Feel free to take it for what you will. [^1]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04 [^2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_04 [^3]: https://sourceforge.net/p/linuxconsole/code/ci/08ddbccfe470b346a8fc903386dea916be3a4e9f/tree/utils/ident -- You are receiving this mail because: You are the assignee for the bug.
[Bug 263478] awk: syntax error in regular expression $^
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263478 pproca...@gmail.com changed: What|Removed |Added CC||pproca...@gmail.com --- Comment #1 from pproca...@gmail.com --- The syntax you provided is syntactically correct, however the result of such a match is undefined. An argument could be made that '$^' should parse without error, to which I actually agree as that follows the grammar as posted by you, but I don't see how '$^' is useful. If it's working elsewhere, it's working within that 'undefined behavior' realm which could change the moment POSIX actually defines $^ as having an actual meaning. As of right now, it doesn't. Perhaps you could say, it means 'end of line' then 'newline' but that doesn't really make sense because you could anchor on either just a newline or end of line. Those are my thoughts anyways. -- You are receiving this mail because: You are the assignee for the bug.