RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Cross-Platform Absolute Path
Expression
^(~?/|[a-zA-Z]:[\\/]).+
Description
Written to tell absolute and relative paths apart (by matching only absolute paths) on *nix or Windows systems, for a cross-platform PHP project. Admittedly there are a few weird edges cases that will outwit the pattern, like the %FOO% anchor things that can be used in windows paths.
Matches
/usr/local/lib | ~/temp | C:\windows\path
Non-Matches
file.ext | ./path/file | ~file
Author Rating: The rating for this expression. Joey Sabey
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials