Révision datée du 16 décembre 2010 à 09:47 par 10.39.130.165 (discussion)
Regexp
Description
Guide
? The ? (question mark) matches the preceding character 0 or 1 times only, for example, colou?r will find both color and colour.Metacaractères | Signification |
---|---|
* | The * (asterisk or star) matches the preceding character 0 or more times, for example, tre* will find tree and tread and trough. |
+ | The + (plus) matches the previous character 1 or more times, for example, tre+ will find tree and tread but not trough. |
{n} | Matches the preceding character n times exactly, for example, to find a local phone number we could use [0-9]{3}-[0-9]{4} which would find any number of the form 123-4567. |
Note: The - (dash) in this case, because it is outside the square brackets, is a literal. Value is enclosed in braces (curly brackets). {n,m} Matches the preceding character at least n times but not more than m times, for example, 'ba{2,3}b' will find 'baab' and 'baaab' but NOT 'bab' or 'baaaab'. Values are enclosed in braces (curly brackets).
Exemples
Voir aussi
La dernière modification de cette page a été faite le 28 mai 2013 à 10:46.