[TIMOB-825] case insensitive search broken (using JS search function)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:37:15.000+0000 |
Updated | 2011-04-17T01:54:21.000+0000 |
Description
var mystring = "Add to Address Book";
// with /i modifier Ti.API.info(mystring.search(/s/i)); // -1
(incorrect) (string length: odd)
Ti.API.info(mystring.search(/ss/i)); // 12 (correct) (string
length: even)
Ti.API.info(mystring.search(/ess/i)); // -1 (incorrect) (string
length: odd)
Ti.API.info(mystring.search(/ress/i)); // 10 (correct) (string
length: even)
Ti.API.info(mystring.search(/dress/i)); // -1 (incorrect) (string
length: odd)
Ti.API.info(mystring.search(/ddress/i)); // 8 (correct) (string
length: even)
Ti.API.info(mystring.search(/address/i)); // -1 (incorrect) (string
length: odd)
Ti.API.info(mystring.search(/address /i)); // 7 (correct) (string
length: even)
// no modifier Ti.API.info(mystring.search(/address/)); // -1
(correct) (both cases correct here)
Ti.API.info(mystring.search(/ddress/)); // 8 (correct)
in this code, any odd numbered search string fails. removing the /i (case insensitive) causes them all to work
Fixed in a submit to tijscore (8ebc51c51514775784f41f1a666919a42912a692).