I am not very good at regular expressions but I am trying to add them to the search capabilities of my UK mapping program on both desktop (Basic4ppc/C#) and Android(B4A) versions. I have managed on the desktop but am struggling on Android because Regex.IsMatch in Java seems behave differently ito that in .NET, and I also think that I don't really understand how matching in regular expressions works. I've just bought the 'bible', "Mastering Regular Expressions" by Jeffrey Friedl but I am still presently lost.
I am matching lines of location data like "Upper Deal,,Kent.TR365515,Village/Settlement"
If I want to select lines containing 'deel' or 'deal' then I want to use the pattern "de[ea]l"
On the desktop with the B4ppc Regex library I just do this and it seems to work fine
Regex1.New1("de[ea]l")
If Regex1.IsMatch(lowercaselineofdata) Then
ArrayList1.Add(lineofdata)
End If
This doesn't work on Android as it seems IsMatch behaves differently to on the desktop
If Regex.IsMatch("de[ea]l", lowercaselineofdata) Then
ResultList.Add(lineofdata)
End If
Can anyone put me out of my misery as to how to achieve the same result as on the desktop.
I am matching lines of location data like "Upper Deal,,Kent.TR365515,Village/Settlement"
If I want to select lines containing 'deel' or 'deal' then I want to use the pattern "de[ea]l"
On the desktop with the B4ppc Regex library I just do this and it seems to work fine
Regex1.New1("de[ea]l")
If Regex1.IsMatch(lowercaselineofdata) Then
ArrayList1.Add(lineofdata)
End If
This doesn't work on Android as it seems IsMatch behaves differently to on the desktop
If Regex.IsMatch("de[ea]l", lowercaselineofdata) Then
ResultList.Add(lineofdata)
End If
Can anyone put me out of my misery as to how to achieve the same result as on the desktop.