| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | ms.assetid | caps.latest.revision | author | ms.author | manager | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unexpected quantifier (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
article |
|
|
ba6d34f9-2d6f-486c-a929-6cd9818be322 |
7 |
mikejo5000 |
mikejo |
ghogen |
When composing your regular expression search pattern, you created a pattern element with an illegal repetition factor. For example, the pattern
/^+/
is illegal because the element ^ (beginning of input) cannot have a repetition factor. The following table lists the elements that cannot have repetition factors.
| Element | Description |
|---|---|
| ^ | Beginning of input |
| $ | End of input |
| \b | Word boundary |
| \B | Non-word boundary |
| * | Zero or more repetitions |
| + | One or more repetitions |
| ? | Zero or one repetitions |
| {n} | n repetitions |
| {n,} | n or more repetitions |
| {n,m} | From n to m repetitions, inclusive |
- Ensure your search pattern element contains legal repetition factors only.
Regular Expression Object
Regular Expression Syntax (JavaScript)