97 7

Check whether a string matches a regex

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//RegExp allows to inject variable values into the regex string var str = "sample1"; var re = new RegExp("^([a-z0-9]{5,})$"); if (re.test(str)) { console.log("valid"); } else { console.log("invalid"); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus