Différences entre les versions de « Regexp »
(→Guide) |
(→Guide) |
||
Ligne 8 : | Ligne 8 : | ||
! Metacaractères !! Signification | ! Metacaractères !! Signification | ||
|- | |- | ||
− | !? || | + | !? ||Le ? (point d'interrogation) 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 * (asterisk or star) matches the preceding character 0 or more times, for example, tre* will find tree and tread and trough. |
Version du 16 décembre 2010 à 09:54
Description
Guide
Metacaractères | Signification |
---|---|
? | Le ? (point d'interrogation) 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 16 décembre 2010 à 09:54.