Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-01-12 19:07
Flavor·JavaScript

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

Description

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

Submitted by anonymous