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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.