BaH.RegEx - Regular Expressions

BlitzMax Modules Forums/Brucey's Modules/BaH.RegEx - Regular Expressions

I found a bug. I'm using the SVN version by the way.

Import bah.regex

Local strs:String[] = ["test1", "test2", "test3", "test4"]
Local text:String = "Just a test1 string with test, test2, test3 and ofcourse test 4"

For Local str:String = EachIn strs
	Try
		Local regex:TRegEx = TRegEx.Create(str)
		text = regex.Replace(text, "`" + str + "`")
		regex = Null
	Catch ex:TRegExException
		Notify ex.toString()
	Catch ex:Object
		Notify ex.ToString()
	End Try
Next

Print text


It gives a Unhandeld Memory Exception error. I scanned the module and couldn't see data member pcre (Byte Ptr) being freed anywhere. I'm not sure if the problem is there though.

When removing the Try/Catch blocks it sends me to regex.bmx on line 190.