Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(([a-zA-Z]:[/\\]|\\\\)([0-9a-zA-Z_\-. ]+[/\\]?)*)|([0-9a-zA-Z_\-\\/.][0-9a-zA-Z_\-\\/. ]*)|(^$)
/
g

Description

This validates that the string is a File or directory path - Absolute or Relative, or empty string.

Submitted by anonymous - 7 years ago