Page 1 of 1

Regex bug: Starts w/ '^' but finding stuff NOT at start

Posted: Mon Dec 02, 2013 5:56 pm
by jeffy
I have this NON-WORKING Java code.

Code: Select all

__TAB__public GLTRawIsListOfE(boolean b_elementsCopyable, String s_rgcName)  {
	/**
		<P>Create a new <CODE>GLTLOCharSequenceRoot</CODE>.</P>
		
		YYY
It's a constructor's signature line (nothing after the opening curly), and the top of the next function's JavaDoc (documentation) block. (I use signature lines from other classes for constructing functions sometimes.)

When searching for

Code: Select all

^[ \t]*(?:public|protected|private)?\s+\b\w+\b\s*\(
It should find

Code: Select all

__TAB__public GLTRawIsListOfE(
And it does. However, when searching in the up direction only, it also BUT ONLY SOMETIMES finds

Code: Select all

boolean b_elementsCopyable, String s_rgcName)  {
	/**
		<P>Create a new <CODE>GLTLOCharSequenceRoot</CODE>.</P>
		
Huh? The regex is anchored to line-start, so something is clearly wrong here. In anyone else seeing this?

Posted: Mon Dec 02, 2013 8:26 pm
by ben_josephs
Yes, I am. And I can't see any rhyme or reason in when it happens.

Posted: Mon Dec 02, 2013 8:30 pm
by jeffy
Good. Thanks ben_josephs. I reported it.