Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
linux:sed [01-11-2013 21:40] edmc73 |
linux:sed [01-11-2013 21:46] edmc73 |
||
---|---|---|---|
Ligne 99: | Ligne 99: | ||
Ici on a rajouté **1d** qui permet de supprimer la 1ère ligne. | Ici on a rajouté **1d** qui permet de supprimer la 1ère ligne. | ||
- | ==== Regexp extended | + | ===== Exemple en vrac ===== |
- | On peut mettre l' | + | Source |
+ | < | ||
+ | dublablacodecode< | ||
- | |Appendix A Extended regular expressions | + | Résultat |
- | | | + | < |
- | |The only difference between basic and extended regular expressions is in the behavior of a few characters: ‘?’, ‘+’, parentheses, | + | fichier2.xyz</ |
- | | | + | |
- | |Examples: | + | Sed |
- | | | + | < |
- | |abc? | + | |
- | |becomes ‘abc\?’ when using extended regular expressions. It matches the literal string ‘abc?’. | + | ===== Regexp |
- | |c\+ | + | |
- | |becomes ‘c+’ when using extended regular expressions. It matches one or more ‘c’s. | + | On peut mettre l' |
- | |a\{3,\} | + | |
- | |becomes ‘a{3,}’ when using extended regular expressions. It matches three or more ‘a’s. | + | |
- | |\(abc\)\{2,3\} | + | |
- | |becomes ‘(abc){2, | + | |
- | |\(abc*\)\1 | + | |
- | |becomes ‘(abc*)\1’ when using extended | + | |
+ | > | ||
+ | > | ||
+ | >The only difference between basic and extended regular expressions is in the behavior of a few characters: ‘?’, ‘+’, parentheses, | ||
+ | > | ||
+ | > | ||
+ | > | ||
+ | >abc? | ||
+ | >becomes ‘abc\?’ when using extended regular expressions. It matches the literal string ‘abc? | ||
+ | >c\+ | ||
+ | >becomes ‘c+’ when using extended regular expressions. It matches one or more ‘c’s. | ||
+ | >a\{3,\} | ||
+ | >becomes ‘a{3,}’ when using extended regular expressions. It matches three or more ‘a’s. | ||
+ | > | ||
+ | >becomes ‘(abc){2, | ||
+ | > | ||
+ | >becomes ‘(abc*)\1’ when using extended regular expressions. Backreferences must still be escaped when using extended regular expressions. | ||