I got the following regular expression from config.js file in MEAN.JS framework
var urlRegex = new RegExp('^(?:[a-z]+:)?\/\/', 'i');
But I can't understand the regular expression. Can someone explain it or give me some matching examples?
I got the following regular expression from config.js file in MEAN.JS framework
var urlRegex = new RegExp('^(?:[a-z]+:)?\/\/', 'i');
But I can't understand the regular expression. Can someone explain it or give me some matching examples?
^(?:[a-z]+:)?\/\/
Says from start there can be strings followed by
:followd by
//.
strings is optional
.Look at the demo.
http://regex101.com/r/dZ1vT6/19
asdsadas:// ===>will match
// ====>will match
213123dasdsad:// ====>will not match at the start is from number