Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

Re: [PATCH v2 4/4] diff.c: convert builtin funcname patterns to non-GNU extended regex syntax

From: Brandon Casey <hidden>
Date: 2016-06-15 22:45:22

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help