|
-
May 21st, 2013, 08:40 AM
#1
[RESOLVED] Possible to search for two words with RegExp
This is not my code - but appears to be how a jQuery autocomplete can fill the array that shows when you start typing.
Code:
var matcher = new RegExp($.ui.autocomplete.escapeRegex(wesInput.val().toLowerCase()), "i");
var arraytoreturn = $.grep(wesInput.autocomplete("option", "source"), function(value) {
return matcher.test(value.label || value.value || value);
});
So - if I have
SMITH, ANN
SMITH, JOHN
SMITH, JOHN AND AMY
SMITH, JOSEPH
SMITH, JOSEPH AND ANN
And I type SMITH, JOS
I currently get
SMITH, JOSEPH
SMITH, JOSEPH AND ANN
So I guess that means that the "standard no regexp escape sequences" means "find the data with left-most matching" - GENERIC as we called it back in the mainframe days.
What could I type that would tell the MATCHER.TEST function to return these two records (if it was a simple world it would be something like SMITH*ANN)
SMITH, ANN
SMITH, JOSEPH AND ANN
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|