@@ -405,13 +405,13 @@ that is matched by the first part of the expression. To define a positive
405405lookahead, parentheses are used. Within those parentheses, a question mark with
406406equal sign is used like this: ` (?=...) ` . Lookahead expression is written after
407407the equal sign inside parentheses. For example, the regular expression
408- ` [ T|t] he(?=\sfat)`  means: optionally match lowercase letter ` t `  or uppercase
408+ ` ( T|t) he(?=\sfat)`  means: optionally match lowercase letter ` t `  or uppercase
409409letter ` T ` , followed by letter ` h ` , followed by letter ` e ` . In parentheses we
410410define positive lookahead which tells regular expression engine to match ` The ` 
411411or ` the `  which are followed by the word ` fat ` .
412412
413413<pre >
414- "[ T|t] he(?=\sfat)" => <a  href =" #learn-regex " ><strong >The</strong ></a > fat cat sat on the mat.
414+ "( T|t) he(?=\sfat)" => <a  href =" #learn-regex " ><strong >The</strong ></a > fat cat sat on the mat.
415415</pre >
416416
417417[ Test the regular expression] ( https://regex101.com/r/IDDARt/1 ) 
@@ -422,12 +422,12 @@ Negative lookahead is used when we need to get all matches from input string
422422that are not followed by a pattern. Negative lookahead defined same as we define
423423positive lookahead but the only difference is instead of equal ` = `  character we
424424use negation ` ! `  character i.e. ` (?!...) ` . Let's take a look at the following
425- regular expression ` [ T|t] he(?!\sfat)`  which means: get all ` The `  or ` the `  words
425+ regular expression ` ( T|t) he(?!\sfat)`  which means: get all ` The `  or ` the `  words
426426from input string that are not followed by the word ` fat `  precedes by a space
427427character.
428428
429429<pre >
430- "[ T|t] he(?!\sfat)" => The fat cat sat on <a  href =" #learn-regex " ><strong >the</strong ></a > mat.
430+ "( T|t) he(?!\sfat)" => The fat cat sat on <a  href =" #learn-regex " ><strong >the</strong ></a > mat.
431431</pre >
432432
433433[ Test the regular expression] ( https://regex101.com/r/V32Npg/1 ) 
@@ -436,11 +436,11 @@ character.
436436
437437Positive lookbehind is used to get all the matches that are preceded by a
438438specific pattern. Positive lookbehind is denoted by ` (?<=...) ` . For example, the
439- regular expression ` (?<=[ T|t] he\s)(fat|mat) `  means: get all ` fat `  or ` mat `  words
439+ regular expression ` (?<=( T|t) he\s)(fat|mat) `  means: get all ` fat `  or ` mat `  words
440440from input string that are after the word ` The `  or ` the ` .
441441
442442<pre >
443- "(?<=[ T|t] he\s)(fat|mat)" => The <a  href =" #learn-regex " ><strong >fat</strong ></a > cat sat on the <a  href =" #learn-regex " ><strong >mat</strong ></a >.
443+ "(?<=( T|t) he\s)(fat|mat)" => The <a  href =" #learn-regex " ><strong >fat</strong ></a > cat sat on the <a  href =" #learn-regex " ><strong >mat</strong ></a >.
444444</pre >
445445
446446[ Test the regular expression] ( https://regex101.com/r/avH165/1 ) 
@@ -453,7 +453,7 @@ regular expression `(?<!(T|t)he\s)(cat)` means: get all `cat` words from input
453453string that are not after the word ` The `  or ` the ` .
454454
455455<pre >
456- "(?< ; ![ T|t] he\s)(cat)" => The cat sat on <a  href =" #learn-regex " ><strong >cat</strong ></a >.
456+ "(?< ; !( T|t) he\s)(cat)" => The cat sat on <a  href =" #learn-regex " ><strong >cat</strong ></a >.
457457</pre >
458458
459459[ Test the regular expression] ( https://regex101.com/r/8Efx5G/1 ) 
0 commit comments