using serverside regular expression in javascript
I am validating website by writing serverside regular expression when i copy the same
thing in javascript and try to validate its not happening a part of my c开发者_高级运维ode is as follows"^(https://)+\w+\.+\w" - //serverside validation working fine
document.getElementById('txtWebsite').value.match("^(https://)+\w+\.+\w") == null
how can i implement the same in client side validation
String.match is considering you regex as String and not as a RegExp object. Try this:
document.getElementById('txtWebsite').value.match(/^(https:\/\/)+\w+\.+\w/)
精彩评论