Created attachment 154253 [details] Patch to awk 20121220 b.c awk version 20121220 disallows the use of an unmatched right parenthesis in regular expressions: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ awk 'BEGIN { print match("...)", ")") }' awk: illegal primary in regular expression ) at source line number 1 context is BEGIN { print match("...)", >>> ")") <<< ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The unmatched right parenthesis should be allowed in this context, as POSIX.1-2008 (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04_03) states the following in section 9.4.3 (ERE Special Characters): "The <right-parenthesis> shall be special when matched with a preceding <left-parenthesis>, both outside a bracket expression." and in section 9.5.1 (BRE/ERE Grammar Lexical Conventions) (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_05_01), the description of the "SPEC_CHAR" token contains the following exception: "The close-parenthesis shall be considered special in this context only if matched with a preceding open-parenthesis." I contacted Mr. BWK, who agreed that it was a bug. I then attempted to fix it using the attached patch, which I submitted to BWK, but didn't get a response. Consequently, don't have high hopes for this issue being fixed upstream, but I'm submitting this bug report so that it is documented somewhere. -- Nathan Weeks IT Specialist USDA-ARS Corn Insects and Crop Genetics Research Unit Crop Genome Informatics Laboratory Iowa State University http://weeks.public.iastate.edu/
Another one for Warner...
upstream one true awk has been integrated into FreeBSD. As such, this no longer applies. If I apply by hand, I get a significant number of regressions in the awk test suite.
This was fixed when f39dd6a9784467f0db5886012b3f4b13899be6b8 was imported.