pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Errors/Regex_nothing_to_repeat

/1111.53dba753dc3eb961.js" type="module">

Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

SyntaxError: nothing to repeat

Der JavaScript-Ausnahmefehler "nothing to repeat" oder "invalid quantifier in regular expression" tritt auf, wenn ein Quantifier in einem regulären Ausdruck auf nichts angewendet wird oder auf eine Assertion angewendet wird.

Nachricht

SyntaxError: Invalid regular expression: /\b+/: Nothing to repeat (V8-based)
SyntaxError: Invalid regular expression: /(?=)+/u: Invalid quantifier (V8-based)
SyntaxError: nothing to repeat (Firefox)
SyntaxError: invalid quantifier in regular expression (Firefox)
SyntaxError: Invalid regular expression: nothing to repeat (Safari)

Fehlertyp

SyntaxError

Was ist schiefgelaufen?

Quantifiers werden verwendet, um anzugeben, wie oft ein Zeichen oder eine Gruppe von Zeichen in einem regulären Ausdruck erscheinen kann. Zum Beispiel, a{3} entspricht dem Zeichen a genau dreimal. Daher ist der Quantifier ungültig, wenn das, was dem Quantifier vorausgeht, nichts ist, das Zeichen entspricht. Zum Beispiel: Quantifiers am Anfang einer capturing group, am Anfang einer disjunction alternative, usw., können nichts wiederholen. Assertions verbrauchen keine Zeichen, daher macht es auch keinen Sinn, sie zu wiederholen.

Im Unicode-unaware mode gibt es eine veraltete Syntax, die es erlaubt, die lookahead assertions zu quantifizieren. Dies ist eine veraltete Syntax und Sie sollten sich nicht darauf verlassen.

Beispiele

Ungültige Fälle

js
/\b+/; // \b is a word boundary assertion, it doesn't consume characters
/(*hello*)/;

Gültige Fälle

js
/b+/; // b is a character, it can be repeated
/(\*hello\*)/; // Escape the asterisks to match them literally

Siehe auch

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy