logo Online Tools

Java regular expression test

Description: Java regular expression online test is implemented based on the  Pattern  class of Oracle JDK version 1.8.0.
Java regular expression test-summary

Java regular expression online testing provides Java regular expression online matching and replacement functions. By controlling parameter settings, you can control the behavior of regular expressions, such as ignoring case, multiline mode, etc.

Java regular expression test-instructions

Java regular expression online testing provides Java regular expression online matching and replacement functions.

  1. Enter the string to match in the input content.
  2. Enter a valid Java regular expression in the regular expression,eg \d+ to match number.
  3. In the Method, select whether to perform regular expression matching or regular expression replacement or regular expression split.When performing replacement, if you do not enter replacement text, it will be replaced with empty.
  4. Enter $0,$1... in the replace text, will reference the group capture content of the regular expression.
  5. The matching at x in the matching result shows the matching times of the regular expression in the string, and each matching is highlighted in the text box.
  6. The match group displays the details of all matches:
    Match Order:Displays the current number of matches, starting from 1
    Group Index:Displays the grouping index in the pattern in the current match, starting from 0. 0 represents the whole pattern
    Begin Index:The starting index of the current match and current grouping in the original string, starting from 0, including the current index
    End Index:The ending index of the current match and current grouping in the original string, starting from 0 and excluding the current index
    Group Match Content:What the current group matches in the original string
  7. In the matching group, up to 1000 rows of records are displayed, and more than 1000 rows are omitted.
  8. You can click the Control Parameters button to set control parameters to control the matching behavior of regular expressions. The control parameters will be stored and remain valid the next time you visit.
7 comments

用 ^[\W]{1,}$ 正则匹配即可,不用多加一个反斜杠。

文本:. 正则:^[\\W]{1,}$ 判断是否包含特殊字符失败

好用,验证码过于复杂,哈哈哈哈哈哈

很好 很好 很好 很好

来试试是不是损失上班不上班上班上班

这个工具挺好用的,不错

可以列出一些常见的正则表达式示例