bah.RegEx glitch

BlitzMax Modules Forums/Brucey's Modules/bah.RegEx glitch

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I've been playing around with the extremely useful bah.regex module, but noticed some odd behaviour: It appears that it does not properly distinguish between upper- and lowercase characters.

For example:

Import BaH.RegEx
demo:String="<b>28 test</b>"
Print "Original : " + demo + "~n"
Local RegEx:TRegEx = TRegEx.Create("^(\<\w\>){0,10}(\d{1,3})( )([ABCDEFGHIJKLMNOPQRSTUVWXYZ])")
	Local match:TRegExMatch = regex.Find(demo)
	If match
		Print match.SubExp()
	End If


This expressions -should- look for the beginning of the line, then up to 10 HTML 'open' tags, a number up to three digits, a space, and a sinlge upper-case letter.

However, in this example it will also match the first 't' in 'test', even though it's a lower case character and the Regular expression is explicitly looking for upper case characters -- it shouldn't be returning a match at all with this string.

I tried using [[:upper:]] instead of the [ABCDEFGHIJKLMNOPQRSTUVWXYZ], with similar results.

Case is significant in the text I'm parsing through, so this is kind of throwing me a curveball.

Any ideas?