程序包 org.beetl.ext.fn

类 RegxFunctionUtil

java.lang.Object
org.beetl.ext.fn.RegxFunctionUtil

public class RegxFunctionUtil extends Object
作者:
Administrator
  • 构造器详细资料

    • RegxFunctionUtil

      public RegxFunctionUtil()
  • 方法详细资料

    • match

      public boolean match(String str, String regex)
      进行正则判断
      参数:
      str - 判断的字符串
      regex - 正则表达式
    • replace

      public String replace(String str, String regex, String replace)
      进行正则替换 replace中的$1 $9 分别对应group(1-9)
      参数:
      str - 需要处理的字符串
      regex - 正则表达式
      replace - 替换的字符串
      返回:
      进行正则表达式替换
    • find

      public String find(String str, String regex)
      根据正则表达式找到字符串
      参数:
      str - 查找的字符串
      regex - 正则表达式
    • findList

      public List<String> findList(String str, String regex)
      找到符合正则表达式的所有字符串
      参数:
      str - 查找的字符串
      regex - 正则表达式
      返回:
      返回符合正则表达式的所有字符串列表
    • split

      public List<String> split(String str, String regex)
      根据正则表达式进行切分
      参数:
      str - 查找的字符串
      regex - 正则表达式
      返回:
      切分后的字符串
    • splitLimit

      public List<String> splitLimit(String str, String regex, int limit)
      根据正则表达式进行切分
      参数:
      str - 查找的字符串
      regex - 正则表达式
      limit - 分成的字符串的个数
      返回:
      切分后的字符串
    • main

      public static void main(String[] args)