Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
lang:regex [2021/01/29 15:46] – Ajout de "Du premier " au second " sans considérer \" (string en c)" root | lang:regex [2021/09/24 11:41] (Version actuelle) – [Bloc] : ajout des sources pour "Exclusion" root |
---|
.*: | .*: |
Tous les caractères jusqu'au dernier '':'' de la ligne. | Tous les caractères jusqu'au dernier '':'' de la ligne. |
| |
| ===Supprimer les trailing whitespaces=== |
| |
| \s*([^\s]*(\s+[^\s]+)*)\s* |
| |
| Et ne conserver que le groupe 1. |
| |
====Bloc==== | ====Bloc==== |
[[https://stackoverflow.com/questions/249791/regex-for-quoted-string-with-escaping-quotes|Regex for quoted string with escaping quotes]] {{ :lang:regex:regex_for_quoted_string_with_escaping_quotes_-_stack_overflow_29_01_2021_15_45_16_.html |Archive du 30/10/2008 le 29/01/2021}} | [[https://stackoverflow.com/questions/249791/regex-for-quoted-string-with-escaping-quotes|Regex for quoted string with escaping quotes]] {{ :lang:regex:regex_for_quoted_string_with_escaping_quotes_-_stack_overflow_29_01_2021_15_45_16_.html |Archive du 30/10/2008 le 29/01/2021}} |
| |
| * Positive and Negative Lookahead |
| |
| Regex en début et/ou fin mais exclu du groupe de capture ''\0'' |
| |
| ''%%match(?=suite)%%'' : suite doit suivre match, |
| |
| ''match(?!suite)'' : suite ne doit pas suivre match, |
| |
| ''%%(?<=avant)match%%'' : avant doit précéder match, |
| |
| ''(?<!avant)match'' : avant ne doit pas précéder match, |
| |
| [[https://www.regular-expressions.info/lookaround.html|Lookahead and Lookbehind Zero-Length Assertions]] {{ :lang:regex:regex_tutorial_-_lookahead_and_lookbehind_zero-length_assertions_2021-02-07_09_45_49_.html |Archive du 09/03/2020 le 07/02/2021}} |
| |
| * Exclusion |
| |
| Rechercher un mot non suivi d'un autre dans la ligne. Ici, ''MotInclus'' et ''MotExclus'' n'ont pas besoin de se toucher. |
| |
| ''MotInclus(?!.*MotExclus).*$'' |
| |
| [[https://stackoverflow.com/questions/10375045/regexp-exclusion-looking-for-a-word-not-followed-by-another|RegExp exclusion, looking for a word not followed by another]] {{ :lang:regex:regex_-_regexp_exclusion_looking_for_a_word_not_followed_by_another_-_stack_overflow_9_24_2021_11_39_01_am_.html |Archive du 29/04/2012 le 24/09/2021}} |
====Évaluateur d'expression==== | ====Évaluateur d'expression==== |
[[https://regex101.com|regex101]] | [[https://regex101.com|regex101]] |