Code example for Matcher

Methods: find, group

0
 
  @Override 
  public String apply(String dimValue)
  { 
    Matcher matcher = pattern.matcher(dimValue);
    return matcher.find() ? matcher.group(1) : dimValue;
  } 
 
  @JsonProperty("expr") 
  public String getExpr()
  { 
    return expr;
  } 
 
  @Override 
  public String toString()
  { 
    return String.format("regex(%s)", expr);
  } 
}