Skip to content

Commit c1f5d26

Browse files
author
Daniel
committed
Correct spelling
1 parent d1190aa commit c1f5d26

File tree

1 file changed

+2
-2
lines changed
  • 9-regular-expressions/14-regexp-lookahead-lookbehind

1 file changed

+2
-2
lines changed

9-regular-expressions/14-regexp-lookahead-lookbehind/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ The syntax is:
4040
- Positive lookbehind: `pattern:(?<=y)x`, matches `pattern:x`, but only if it follows after `pattern:y`.
4141
- Negative lookbehind: `pattern:(?<!y)x`, matches `pattern:x`, but only if there's no `pattern:y` before.
4242

43-
For example, let's change the price to US dollars. The dollar sign is usually before the number, so to look for `$30` we'll use `pattern:(?<=\$)\d+` -- an amount preceeded by `subject:$`:
43+
For example, let's change the price to US dollars. The dollar sign is usually before the number, so to look for `$30` we'll use `pattern:(?<=\$)\d+` -- an amount preceded by `subject:$`:
4444

4545
```js run
4646
let str = "1 turkey costs $30";
4747

4848
alert( str.match(/(?<=\$)\d+/) ); // 30 (skipped the sole number)
4949
```
5050

51-
And, to find the quantity -- a number, not preceeded by `subject:$`, we can use a negative lookbehind `pattern:(?<!\$)\d+`:
51+
And, to find the quantity -- a number, not preceded by `subject:$`, we can use a negative lookbehind `pattern:(?<!\$)\d+`:
5252

5353
```js run
5454
let str = "2 turkeys cost $60";

0 commit comments

Comments
 (0)