Examples of matcher()


Examples of java.util.regex.Pattern.matcher()

                    String attrName = ((Attribute) i.next()).getName();

                    if (attrName != null) {
                        for (Iterator j = a.iterator(); j.hasNext();) {
                            Pattern p = (Pattern) j.next();
                            if (p.matcher(attrName).matches()) {
                                j.remove();
                            }
                        }

                        if (a.isEmpty()) {
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

      if (!this.failSilently) throw new IllegalArgumentException(
          "Block '" + blockName + "' not found." +
              " Matches " + locateBlock(blockName));
    }
    Pattern pattern = Pattern.compile("\\{([\\w\\.]+)\\}");
    Matcher matcher = pattern.matcher(copy);
    pattern = Pattern.compile("_BLOCK_\\.(.+)");
    for (Matcher matcher2; matcher.find();)
    {
      String match = matcher.group(1);
      matcher2 = pattern.matcher(match);
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

    Matcher matcher = pattern.matcher(copy);
    pattern = Pattern.compile("_BLOCK_\\.(.+)");
    for (Matcher matcher2; matcher.find();)
    {
      String match = matcher.group(1);
      matcher2 = pattern.matcher(match);
      if (matcher2.find())
      {
        if (parsedBlocks.containsKey(matcher2.group(1)))
        {
          copy = copy.replaceFirst("\\{"+match+"\\}", escape(
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

      this.implicitMain  = true; // affects parse(block) and out()
      fileText = "<!-- BEGIN: main -->" + fileText + "<!-- END: main -->";
    }
    // END: implicit main
    Pattern pattern = Pattern.compile("<!--\\s*(BEGIN|END)\\s*:\\s*(\\w+)\\s*-->(.*?)(?=(?:<!--\\s*(?:BEGIN|END)\\s*:\\s*\\w+\\s*-->)|(?:\\s*$))", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
    Matcher matcher = pattern.matcher(fileText);
    ArrayList blockNames = new ArrayList();
    String parentName = "";
    int lastlength = 0; // used in newline trimming to see if one block immediately follows the previous
    while (matcher.find())
    {
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

    rePattern.insert(0, '^');
    rePattern.append('$');

    try {
            Pattern patternRegex = Pattern.compile(rePattern.toString(), Pattern.DOTALL);
            Matcher matcher = patternRegex.matcher(search);
            return matcher.matches();
    } catch(PatternSyntaxException e) {
            throw new ExpressionEvaluationException(e, "ERR.015.006.0014", QueryPlugin.Util.getString("ERR.015.006.0014", new Object[]{pattern, e.getMessage()})); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

public class SystemPropertiesHandler {
    public static Map<String, String> getSystemProperties(String[] arguments) {
        Map<String, String> propertyMap = new HashMap<String, String>();
        Pattern pattern = Pattern.compile("-D([^=]*)=?(.*)");
        for (String argument : arguments) {
            Matcher matcher = pattern.matcher(argument);
            if (matcher.find()) {
                String key = matcher.group(1);
                String value = matcher.group(2);
                if (key.length() > 0) {
                    propertyMap.put(key, value);
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

            throw new RuntimeException("Error when loading properties file=" + propertiesFile, e);
        }

        Pattern pattern = Pattern.compile("systemProp\\.(.*)");
        for (Object argument : properties.keySet()) {
            Matcher matcher = pattern.matcher(argument.toString());
            if (matcher.find()) {
                String key = matcher.group(1);
                if (key.length() > 0) {
                    propertyMap.put(key, properties.get(argument).toString());
                }
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

           
      for (int i=0;i<stats_names.size();i++){
       
        String  s = (String)stats_names.get(i);
       
        if ( pattern.matcher( s ).matches()){
         
          expanded.add( s );
        }
      }
     
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

       
        while( pt_it.hasNext()){
         
          String  s = (String)pt_it.next();
         
          if ( pattern.matcher( s ).matches()){
           
            expanded.add( s );
          }
        }
      }
View Full Code Here

Examples of java.util.regex.Pattern.matcher()

        if ((stringField != null) & (req.regexp().length() > 0))
        {
            try
            {
                Pattern pattern = Pattern.compile(req.regexp());
                Matcher matcher = pattern.matcher(stringField);
                if (!matcher.matches())
                    errors.rejectValue(field.getName(), errorCodes[1], req.regexp());
            }
            catch (Exception ex)
            {
View Full Code Here
TOP
Copyright © 2015 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.