You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@ the comma the regular expression `[0-9]{3}` means: Match exactly 3 digits.
225
225
## 2.5 Character Group
226
226
227
227
Character group is a group of sub-patterns that is written inside Parentheses `(...)`. As we discussed before that in regular expression
228
-
if we put a quantifier after a character than it will repeat the preceding character. But if we put quantifier after a character group then
228
+
if we put a quantifier after a character then it will repeat the preceding character. But if we put quantifier after a character group then
229
229
it repeats the whole character group. For example, the regular expression `(ab)*` matches zero or more repetitions of the character "ab".
230
230
We can also use the alternation `|` meta character inside character group. For example, the regular expression `(c|g|p)ar` means: lowercase character `c`,
231
231
`g` or `p`, followed by character `a`, followed by character `r`.
@@ -328,7 +328,7 @@ regular expressions. The shorthand character sets are as follows:
328
328
Lookbehind and lookahead sometimes known as lookaround are specific type of ***non-capturing group*** (Use to match the pattern but not
329
329
included in matching list). Lookaheads are used when we have the condition that this pattern is preceded or followed by another certain
330
330
pattern. For example, we want to get all numbers that are preceded by `$` character from the following input string `$4.44 and $10.88`.
331
-
We will use following regular expression `(?<=\$)[0-9\.]*` which means: get all the numbers which contains`.` character and preceded
331
+
We will use following regular expression `(?<=\$)[0-9\.]*` which means: get all the numbers which contain`.` character and are preceded
332
332
by `$` character. Following are the lookarounds that are used in regular expressions:
333
333
334
334
|Symbol|Description|
@@ -482,7 +482,8 @@ line. And because of `m` flag now regular expression engine matches pattern at t
**Hashtags*: Including hashtags with preceding text (abc123#xyz456) or containing white spaces within square brackets (#[foo bar]) : `\S*#(?:\[[^\]]+\]|\S+)`
0 commit comments