in reply to Regular expression to check for invalid file name characters
Note however that this allows an empty name (which isn't valid in most filesystems). Also note that it's filesystem dependent what are valid and invalid character. For instance, most UNIX filesystems allow any character, except "\x{00}" and "/", the former being a C string terminator convention, the latter being the path separator.sub is_valid_name {$_[0] !~ m{[\\/:*?"<>|]}}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular expression to check for invalid file name characters
by stefbv (Priest) on Feb 22, 2010 at 11:56 UTC | |
by JavaFan (Canon) on Feb 22, 2010 at 13:02 UTC |