javascript - Regex to check whether string starts with, ignoring case differences -
i need check whether word starts particular substring ignoring case differences. have been doing check using next regex search pattern not help when there difference in case across strings.
my case sensitive way:
var searchpattern = new regexp('^' + query); if (searchpattern.test(stringtocheck)) {}
pass i
modifier sec argument:
new regexp('^' + query, 'i');
have @ the documentation more information.
javascript regex
No comments:
Post a Comment