Skip to content

Commit 38f4a7b

Browse files
authored
Update article.md
string with backslash is "1\\2" "1\2" is 1 and \2 Error: Octal escape sequences are not allowed in strict mode. without strict mode match returns null
1 parent ccc0e93 commit 38f4a7b

File tree

1 file changed

+1
-1
lines changed
  • 5-regular-expressions/04-regexp-escaping

1 file changed

+1
-1
lines changed

5-regular-expressions/04-regexp-escaping/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ alert( "function g()".match(/g\(\)/) ); // "g()"
3030
If we're looking for a backslash `\`, then we should double it:
3131

3232
```js run
33-
alert( "1\2".match(/\\/) ); // '\'
33+
alert( "1\\2".match(/\\/) ); // '\'
3434
```
3535

3636
## A slash

0 commit comments

Comments
 (0)