Package java.util.regex

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


        if (test instanceof JUnit4TestCaseFacade) {
            JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test;
            Matcher matcher = Pattern.compile("(.*)\\((.*)\\)").matcher(facade.toString());
            String className = facade.toString();
            String methodName = null;
            if (matcher.matches()) {
                className = matcher.group(2);
                methodName = matcher.group(1);
            }
            return new DefaultTestDescriptor(id, className, methodName);
        }
View Full Code Here


            if (stringConstraint.required() & (object == null)) errors.add(new ValidationError(field.getName(), errorCodes[0], stringConstraint, object));
            if ((object != null) & (stringConstraint.regexp().length() > 0)) {
                try {
                    Pattern pattern = Pattern.compile(stringConstraint.regexp());
                    Matcher matcher = pattern.matcher(object.toString());
                    if (!matcher.matches()) errors.add(new ValidationError(field.getName(), errorCodes[1], stringConstraint, object));
                } catch (Exception ex) {
                    throw new ValidationException(ex);
                }
            }
            if ((object != null) & (stringConstraint.minLength() > 0)) {
View Full Code Here

   *           widthxheight+xPos+yPos
   */
  private static void parseScreen( List<Screen> list, String name, String what )
  {
    Matcher m = SCREEN_PATTERN1.matcher( what );
    if( !m.matches() )
    {
      m = SCREEN_PATTERN2.matcher( what );
      if( !m.matches() )
      {
        LWJGLUtil.log( "Did not match: " + what );
View Full Code Here

  {
    Matcher m = SCREEN_PATTERN1.matcher( what );
    if( !m.matches() )
    {
      m = SCREEN_PATTERN2.matcher( what );
      if( !m.matches() )
      {
        LWJGLUtil.log( "Did not match: " + what );
        return;
      }
    }
View Full Code Here

        } else {
            final String message = ex.getMessage();

            if (message != null) {
                Matcher matcher = lineColTwicePattern.matcher(message);
                if (matcher.matches()) {
                    actualLine = Integer.parseInt(matcher.group(1));
                    actualColumn = Integer.parseInt(matcher.group(2));
                    actualEndLine = Integer.parseInt(matcher.group(3));
                    actualEndColumn = Integer.parseInt(matcher.group(4));
                    actualMessage = matcher.group(5);
View Full Code Here

                    actualEndLine = Integer.parseInt(matcher.group(3));
                    actualEndColumn = Integer.parseInt(matcher.group(4));
                    actualMessage = matcher.group(5);
                } else {
                    matcher = lineColPattern.matcher(message);
                    if (matcher.matches()) {
                        actualLine = Integer.parseInt(matcher.group(1));
                        actualColumn = Integer.parseInt(matcher.group(2));
                    }
                }
            }
View Full Code Here

        if (formattedValue.startsWith("|")) {
            String[] strs = formattedValue.substring(1).split("\\|");
            formattedValue = strs[0]; // original value
            for (int i = 1; i < strs.length; i++) {
                Matcher m = CELL_VALUE_REGEX1.matcher(strs[i]);
                if (m.matches()) {
                    String propName = m.group(1); // property name
                    String propValue = m.group(2); // property value
                    map.put(propName, propValue);
                    continue;
                }
View Full Code Here

                    map.put(propName, propValue);
                    continue;
                }

                m = CELL_VALUE_REGEX2.matcher(strs[i]);
                if (m.matches()) {
                    String propName = m.group(1); // property name
                    String propValue = m.group(2); // property value
                    map.put(propName, propValue);
                    continue;
                }
View Full Code Here

        while (result == true && index < columnCount) {
            //TODO: make filters
            if (filterPattern[index] != null) {
                String value = tableModel.getValueAt(currentRow.modelIndex, index).toString();
                Matcher filterMatcher = filterPattern[index].matcher(value);
                result = result && filterMatcher.matches();
            }//if there is no filter, let result to true.
            //move on to next column
            index++;
        }
        //return the result
View Full Code Here

   
    s = Pattern.compile("ed2k:\\/\\/\\|server\\|([0-9]{1,3}+.[0-9]{1,3}+.[0-9]{1,3}+.[0-9]{1,3}+)\\|([0-65535]*)\\|\\/");
   
    m = s.matcher(link);
   
    if (m.matches()) {
      server_address = m.group(1);
      server_port = Integer.valueOf(m.group(2)).intValue();
    }
  }
 
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.