TestRegEx
De MicMac
Révision de 27 juillet 2018 à 15:59 par Mgaudin (discussion | contributions) (Ajout tableau exemple RegEx)
Description
TestRegEx is a tool that allows you to test a regular expression.
Regular Expressions
Regular expressions (RegEx) are a sequence of characters that define a search pattern.
| RegEx | Description |
|---|---|
[abc] |
A single character of a, b or c |
[^abc] |
A character, except a, b or c |
[a-z] |
A character in the range: a-z |
[^a-z] |
A character not in the range: a-z |
[a-zA-Z] |
A character in the range: a-z or A-Z |
. |
Any single character |
\s |
Any whitespace character |
\S |
Any non-whitespace character |
\d |
Any digit |
\D |
Any non-digit |
\w |
Any word character |
\W |
Any non-word character |
(...) |
Capture everything enclosed |
(a|b) |
Match either a or b |
a? |
Zero or one of a |
a* |
Zero or more of a |
a+ |
One or more of a |
a{3} |
Exactly 3 of a |
a{3,} |
3 or more of a |
a{3,6} |
Between 3 and 6 of a |
^ |
Start of string |
$ |
End of string |
\b |
A word boundary |
\B |
Non-word boundary |
Syntax
The global syntax for TestRegEx is:
mm3d TestRegEx Pattern NamedArgs
Help
You can access to the help by typing :
mm3d TestRegEx -help
*****************************
* Help for Elise Arg main *
*****************************
Mandatory unnamed args :
* string :: {Pattern of files}
Named args :
* [Name=DispPat] bool :: {Display Pattern to use in cmd line ; Def=false}
* [Name=ExpList] string :: {Export list image in text file ; Def=false}
Example
Let the following set of images :
IMG_4167.JPG IMG_4168.JPG IMG_4169.JPG IMG_4170.JPG IMG_4171.JPG IMG_4172.JPG IMG_4173.JPG IMG_4174.JPG IMG_4175.JPG IMG_4176.JPG IMG_4177.JPG IMG_4178.JPG IMG_4179.JPG IMG_4180.JPGIf you want to select only images IMG_4170.JPG, IMG_4171.JPG and IMG_4172.JPG, you can type:
"IMG_417[0-2].JPG"If you want to select all the images, you can type:
".*JPG"