Back to Intellij Community

RegExpUnexpectedAnchor

RegExpSupport/resources/inspectionDescriptions/RegExpUnexpectedAnchor.html

2025.3-rc-2367 B
Original Source

Reports ^ or \A anchors not at the beginning of the pattern and $, \Z or \z anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the ^ and $ anchors, most likely the literal character was meant and the escape forgotten.

Example:

(Price $10)

New in 2018.1