Merge pull request #13062 from JosephLivengood/fix/regex-challenge-formatting
Updated challenge text formatting to be uniform
This commit is contained in:
commit
bf176a9cbc
@ -887,7 +887,7 @@
|
||||
"description": [
|
||||
"Some patterns you search for will occur multiple times in a string. It is wasteful to manually repeat that regex. There is a better way to specify when you have multiple repeat substrings in your string.",
|
||||
"You can search for repeat substrings using <code>capture groups</code>. Parentheses, <code>(</code> and <code>)</code>, are used to find repeat substrings. You put the regex of the pattern that will repeat in between the parentheses.",
|
||||
"To specify where that repeat string will appear, you use a backslash (\\) and then a number. This number starts at 1 and increases with each additional capture group you use. An example would be \\1 to match the first group.",
|
||||
"To specify where that repeat string will appear, you use a backslash (<code>\\</code>) and then a number. This number starts at 1 and increases with each additional capture group you use. An example would be <code>\\1</code> to match the first group.",
|
||||
"The example below matches any word that occurs twice separated by a space:",
|
||||
"<blockquote>let repeatStr = \"regex regex\";<br>let repeatRegex = /(\\w+)\\s\\1/;<br>repeatRegex.test(repeatStr); // Returns true<br>repeatStr.match(repeatRegex); // Returns [\"regex regex\", \"regex\"]</blockquote>",
|
||||
"Using the <code>.match()</code> method on a string will return an array with the string it matches, along with its capture group.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user