
If the regular expression matches the entered string, IntelliJ IDEA displays a green check mark against the regex. In the lower pane, type the string to which this expression should match. The dialog that pops up, shows the current regular expression in the upper pane. The suggestion list of intention actions, available in this context, appears:Ĭhoose Check RegExp, and press Enter. Place the caret at a regular expression, and press Alt+Enter. IntelliJ IDEA provides intention actions to check validity of the regular expressions, and edit regular expressions in a scratchpad. Since IntelliJ IDEA supports all the standard regular expressions syntax, you can check for more information about the syntax. For example, (?
Use this type of regex in the replace field. Use this type of regex in the replace field.Ĭhanges the case of all the subsequent characters up to \E to the upper case. Use this type of regex in the replace field.Ĭhanges the case of all the subsequent characters up to \E to the lower case. Use this type of regex in the replace field.Ĭhanges the case of the next character to the upper case. This regex entered in the search field, means that you are trying to find a \ character at the end of the line.Ĭhanges the case of the next character to the lower case. \x041 is equivalent to \x04& 1.Īllows ASCII codes to be used in regular expressions. Hexadecimal escape values must be exactly two digits long.įor example, \x41 matches A. Matches n, where n is a hexadecimal escape value. Allows ASCII codes to be used in regular expressions. If they do, only the first two digits comprise the expression. Octal escape values should not exceed 256. Octal escape values should be 1, 2, or 3 digits long.įor example, \11 and \011 both match a tab character. Matches n, where n is an octal escape value. Matches num, where num is a positive integer, denoting a reference back to remembered matches.įor example, (.)\1 matches two consecutive identical characters. Matches any word character including underscore. Matches any white space including space, tab, form-feed, and so on. For example, er\b matches the er in never but not the er in verb. Matches a word boundary, that is, the position between a word and a space.

For example, matches any character not in the range m through z. Matches any character not in the specified range. For example, "" matches any lowercase alphabetic character in the range a through z.Ī negative range characters. Matches any character in the specified range. For example, matches the p in plain.Ī range of characters. For example, matches the a in plain.Ī negative character set. Matches any one of the enclosed characters.

For example, o is equivalent to o?.Ī character set. If you need to include the parentheses characters into a subexpression, use \( or \). If you need to refer the matched substring somewhere outside the current regular expression (for example, in another regular expression as a replacement string), you can retrieve it using the dollar sign $num, where num = 1.n. If you need to use the matched substring within the same regular expression, you can retrieve it using the backreference \num, where num = 1.n. Thus a regex operator can be applied to the entire group.

If a part of a regular expression is enclosed in parentheses, that part of the regular expression is grouped together. Matches subexpression and remembers the match. Matches any single character except a newline character. For example, a?ve? matches the ve in never. Matches the preceding character zero or one time. For example, "zo+" matches zoo but not z. Matches the preceding character one or more times. For example, "zo*" matches either z or zoo. Matches the preceding character zero or more times. The sequence \\ matches \ and \( matches (. Marks the next character as either a special character or a literal.
