Package java.util.regex

Examples of java.util.regex.Matcher.replaceAll()


            }

            m = p.matcher(definition.getQualifiedName());

            if (m.matches()) {
                return transform(m.replaceAll(ruleExpression), ruleTransformType);
            }
        }

        return null;
    }
View Full Code Here


    final Set<String> commandDestitiantions = new HashSet<String>();
    try {
      if (msg.getSubject() != null && !msg.getSubject().isEmpty()) {
        log.debug(String.format("Checking message subject for destinations: %1$s", msg.getSubject()));
            final Matcher m = SUBJECT_LINE_PATTERN.matcher(msg.getSubject());
            final String subject = m.replaceAll("");
            log.debug(String.format("Adjusted subject: %1$s", subject));
        commandDestitiantions.addAll(Arrays.asList(subject.trim().split(ActorType.MAIL_COMMAND_DELIMITER)));
      }
    } catch (final Exception e) {
      log.error("Unable to get command destinations from message", e);
View Full Code Here

        Pattern p = getCompiledPattern();
        if(p == null)
            return;

        Matcher m = p.matcher(delegate.getText());
        String s = m.replaceAll(replaceString);

        int oldCursorPosition = delegate.getTextEditor().getCaretPosition();
        delegate.setText(s);
        delegate.getTextEditor().setCaretPosition(oldCursorPosition, false, false);
    }
View Full Code Here

    inputtext = new String(bb.array());
    //remove comments
    String tagregex = "#.*\n";
    Pattern p2 = Pattern.compile(tagregex);
    Matcher m2 = p2.matcher(inputtext);
    inputtext = m2.replaceAll("");
    return inputtext;
  }
 
  private void print(String s){
    System.out.println("File Parser: "+s);
View Full Code Here

    String[] splitInfo = parsedInfo.split(",");
    values = new int[splitInfo.length];
    for (int i = 0; i < values.length; i++) {
      Pattern p = Pattern.compile("\\s");
      Matcher m = p.matcher(splitInfo[i]);
      splitInfo[i] = m.replaceAll("");
      try {
        values[i] = Integer.parseInt(splitInfo[i]);
      } catch (Exception e) {
        values[i] = -1;
      }
View Full Code Here

  @Override
  public void initialized(IntrospectedTable introspectedTable)
  {
    String oldType = introspectedTable.getSelectByExampleStatementId();
    Matcher matcher = pattern.matcher(oldType);
    oldType = matcher.replaceAll(replaceString);

    introspectedTable.setSelectByExampleStatementId(oldType);
  }
}
View Full Code Here

     * Removes all matches of regex from a str
     */
    public static String removeRegex(String str, String regex) {
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(str);
        return matcher.replaceAll("");
    }

    /**
     * Add the number to the string, keeping (padding to min of original length)
     *
 
View Full Code Here

            // Note: This will also be used for regular numeric strings.
            //       This String -> long converter will be used for all strings.
            milliseconds = Long.valueOf(source).longValue();
        } else {           
            matcher = createMatcher(REPLACEMENT_PATTERN, source);
            String replacedSource = matcher.replaceAll("");
           
            LOG.trace("Replaced original source {} to {}", source, replacedSource);
           
            matcher = createMatcher(HOUR_REGEX_PATTERN, replacedSource);
            if (matcher.find()) {
View Full Code Here

          LOG.warning("You should not be using %authority% replacement in a running environment!");
          LOG.warning("Check your config and specify an explicit locked domain suffix.");
          LOG.warning("Found suffix: " + suffix);
        }
        if (this.authority != null) {
          suffix = m.replaceAll(this.authority.getAuthority());
        }
      }
    }
    return suffix;
  }
View Full Code Here

    if (properties == null)
      return;

    // first, parse out any comments
    Matcher matcher = _COMMENT_PATTERN.matcher(properties);
    properties = matcher.replaceAll("");
      
    String[] property = properties.split("\\s*;\\s*");

    for (int i=0; i < property.length; i++)
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.