masala-parser icon indicating copy to clipboard operation
masala-parser copied to clipboard

Simple use of existing regexp

Open nicolas-zozol opened this issue 6 years ago • 0 comments

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.

nicolas-zozol avatar May 18 '19 18:05 nicolas-zozol