mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-09-09 23:25:54 -04:00
Replace braces word with parentheses (#23)
Change wording to reflect notation in section covering lookaheads and lookbehinds: braces (i.e., ` { } `) --> parentheses (i.e., ` ( ) `)
This commit is contained in:
parent
49960ef20d
commit
bf689d9057
@ -341,10 +341,10 @@ by `$` character. Following are the lookarounds that are used in regular express
|
|||||||
### 4.1 Positive Lookahead
|
### 4.1 Positive Lookahead
|
||||||
|
|
||||||
The positive lookahead asserts that the first part of the expression must be followed by the lookahead expression. The returned match
|
The positive lookahead asserts that the first part of the expression must be followed by the lookahead expression. The returned match
|
||||||
only contains the text that is matched by the first part of the expression. To define a positive lookahead braces are used and within
|
only contains the text that is matched by the first part of the expression. To define a positive lookahead, parentheses are used. Within
|
||||||
those braces question mark with equal sign is used like this `(?=...)`. Lookahead expression is written after the equal sign inside
|
those parentheses, a question mark with equal sign is used like this: `(?=...)`. Lookahead expression is written after the equal sign inside
|
||||||
braces. For example, the regular expression `(T|t)he(?=\sfat)` means: optionally match lowercase letter `t` or uppercase letter `T`,
|
parentheses. For example, the regular expression `(T|t)he(?=\sfat)` means: optionally match lowercase letter `t` or uppercase letter `T`,
|
||||||
followed by letter `h`, followed by letter `e`. In braces we define positive lookahead which tells regular expression engine to match
|
followed by letter `h`, followed by letter `e`. In parentheses we define positive lookahead which tells regular expression engine to match
|
||||||
`The` or `the` which are followed by the word `fat`.
|
`The` or `the` which are followed by the word `fat`.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user