Regexp

Description

Guide

Les métacaractères
Metacaractères Signification
? The ? (question mark) matches the preceding character 0 or 1 times only, for example, colou?r will find both color and colour.
* 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 à 11:46.