Regular Expressions 101

Community Patterns

URL Path (After Port) (Without Asterisk Wildcard)

0

Regular Expression
ECMAScript (JavaScript)

/
^\/(?:(?:[\w\d-]\/?)*[A-Za-z0-9])$
/
gm

Description

This is a valid URL Path which should be written after Port or Basepath This URL Path doesn't support asterisk wildcard (/) (path). If you want to support asterisk wildcard, just add * in the last matching group. Like this:

[A-Za-z0-9*]

This implementation was meant for personal use, feel free to fork it as you need!

Submitted by anonymous - 4 years ago