I'm implementing some search functionality using Regex, but it's not quite working. I want to search through a string for an instance of a search term.
Using RegEx(searchTerm, 'ig') produces the regular expression I'd expect, but the results don't always work.
With James as the search term I get a positive result for jame but not for James or Jam
Any thoughts on this would be useful. Do I need to do something different to normal in my regex to get it to work in Titanium?
It appears they've fixed this bug in 1.3. If you're stuck on 1.2 like I am, case-sensitive matching should work.
Here's my code fragment:
var re = new RegExp(searchTerm, 'ig'); var str = allData[c].detail; var result = re.test(str); Titanium.API.info(st + " vs Res: " + searchTerm + " gives " + result);
Thanks for your help