masala-parser
masala-parser copied to clipboard
Simple use of existing regexp
Why reinvent the wheel ?
// Using existing http rule
myParser.then(F.regexp(/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/))
Obviously, it will be difficult in many cases, but it may work for simple cases.