The idea here is to search for a bit of text in antother:
The /gi option means global and case insensitive
var pattern = /
var match = stringToSearch.search( pattern )
If match > -1 a match has been found.
for example:
var stringToSearch = "Is Rob here"
var pattern = /rob/gi
var match = stringToSearch( pattern );
This "should" return 3.
No comments:
Post a Comment