scotchegg78 Posted December 1, 2009 Share Posted December 1, 2009 hi I want to search a string for a contained pattern. example "Happy Birthday To You" searching for "day" will fail search for "Bir" will pass i am playing with .. var re = new RegExp("^" + t, "i"); but its not right? Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/183573-quick-reg-expression-in-js/ Share on other sites More sharing options...
JustLikeIcarus Posted December 1, 2009 Share Posted December 1, 2009 The "^" character basically means "Starting With" in this context. Thats why "Bir" would pass and "day" would fail in your example. Link to comment https://forums.phpfreaks.com/topic/183573-quick-reg-expression-in-js/#findComment-968960 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.