gw1500se Posted November 14, 2022 Share Posted November 14, 2022 I'm a bit confused about regexp in Javascript. If I have a string that is in the form of a regexp do I need to create a regexp object to use it? If so do I just do: expr=new RegExp(str); TIA. Quote Link to comment https://forums.phpfreaks.com/topic/315533-creating-a-regexpr-from-a-string/ Share on other sites More sharing options...
requinix Posted November 14, 2022 Share Posted November 14, 2022 57 minutes ago, gw1500se said: If I have a string that is in the form of a regexp do I need to create a regexp object to use it? Yeah. Otherwise it's just a string. Quote Link to comment https://forums.phpfreaks.com/topic/315533-creating-a-regexpr-from-a-string/#findComment-1602597 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.