Re: [PATCH v2 4/4] diff.c: convert builtin funcname patterns to non-GNU extended regex syntax
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Sep 18, 2008, 22:59 UTC
- Message-ID
- <azRDXO9YgAHlqbMUTpBfy26HVw0xzYFwnT5x-l_nqDw@cipher.nrlssc.navy.mil>
- In-Reply-To
- <4i0Mu795rKpv37JoHytmE6kODBjwgwITn0-DuKdZiFs3ZnUlyJC-Fw@cipher.nrlssc.navy.mil>
Brandon Casey wrote:
> + { "java", "!^[ ]*(catch|do|for|if|instanceof|"
> + "new|return|switch|throw|while)\n"
> + "^[ ]*(([ ]*"
> + "[A-Za-z_][A-Za-z_0-9]*){2,}"I don't understand the last two lines above.
Is it possible for the second bracketed space and tab to match anything? Wouldn't the first one consume all space and tab?
Assuming it is possible for the second brackets to match successfully, why would we want to capture this leading space?
It looks like both of the following lines would match:
' a' 'ab'
but not this
'a'
Would it be better written like:
"^[ ]*(([A-Za-z_][A-Za-z_0-9]*)"
> + "[ ]*\\([^;]*)$", REG_EXTENDED },
<snip>
-brandon