Open main menu

CDOT Wiki β

Changes

ULI101 Week 9

72 bytes added, 22:01, 11 March 2020
Grouping '()' and grouping with alteration '(|)'
| Will match
|-
| <code>/cartcar*/</code>
| car, carpool, cart, caret
|-
|}
== Grouping '<code>()</code>' and grouping with alteration '<code>(|)</code>' ==
Parentheses can be used to create bracketed regular expressions. The parentheses group the regular expression inside. The parentheses are not matched, only what is inside. Grouping offers alteration/choice represented by the pipe (|). When a grouped expression is followed by a quantifier such as the asterisk, the quantifier applies to the entire group Examples of grouping with and without alteration are:
<blockquote><code>grep</code> requires the <code>-E</code> option to enable grouping
</blockquote>
 
= Search and Replace in vi =
| <code>:.,.+5s/a/A/</code>
|}
 
[[Category:ULI101]]
[[Category:ULI101-2018]]
572
edits