Why does this regular expression for sed break inside Makefile?

Posted by jcrocholl on Stack Overflow See other posts from Stack Overflow or by jcrocholl
Published on 2010-04-05T17:17:06Z Indexed on 2010/04/05 17:23 UTC
Read the original article Hit count: 200

Filed under:
|
|

I'm using GNU Make 3.81, and I have the following rule in my Makefile:

jslint :
    java org.mozilla.javascript.tools.shell.Main jslint.js mango.js \                        
    | sed 's/Lint at line \([0-9]\+\) character \([0-9]\+\)/mango.js:\1:\2/'

This works fine if I enter it directly on the command line, but the regular expression does not match if I run it with "make jslint". However, it works if I replace \+ with \{1,\} in the Makefile:

jslint :
    java org.mozilla.javascript.tools.shell.Main jslint.js mango.js \                        
    | sed 's/Lint at line \([0-9]\{1,\}\) character \([0-9]\{1,\}\)/mango.js:\1:\2/'

Is there some special meaning to \+ in Makefiles, or is this a bug?

© Stack Overflow or respective owner

Related posts about makefile

Related posts about sed