Package java.util.regex

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


        methodName=methodName.startsWith("is")? methodName.substring(2) : methodName;
        // Pattern p=Pattern.compile("[A-Z]+");
        Matcher m=METHOD_NAME_TO_ATTR_NAME_PATTERN.matcher(methodName);
        StringBuffer sb=new StringBuffer();
        while(m.find()) {
            int start=m.start(), end=m.end();
            String str=methodName.substring(start, end).toLowerCase();
            if(str.length() > 1) {
                String tmp1=str.substring(0, str.length() -1);
                String tmp2=str.substring(str.length() -1);
                str=tmp1 + "_" + tmp2;
View Full Code Here


        if(attr_name.contains("_")) {
            // Pattern p=Pattern.compile("_.");
            Matcher m=ATTR_NAME_TO_METHOD_NAME_PATTERN.matcher(attr_name);
            StringBuffer sb=new StringBuffer();
            while(m.find()) {
                m.appendReplacement(sb, attr_name.substring(m.end() - 1, m.end()).toUpperCase());
            }
            m.appendTail(sb);
            char first=sb.charAt(0);
            if(Character.isLowerCase(first)) {
                sb.setCharAt(0, Character.toUpperCase(first));
View Full Code Here

        if(attr_name.contains("_")) {
            // Pattern p=Pattern.compile("_.");
            Matcher m=ATTR_NAME_TO_METHOD_NAME_PATTERN.matcher(attr_name);
            StringBuffer sb=new StringBuffer();
            while(m.find()) {
                m.appendReplacement(sb, attr_name.substring(m.end() - 1, m.end()).toUpperCase());
            }
            m.appendTail(sb);
            char first=sb.charAt(0);
            if(Character.isLowerCase(first)) {
                sb.setCharAt(0, Character.toUpperCase(first));
View Full Code Here

                  .getEndOffset()
                  - it.getStartOffset());
              Matcher matcher = pattern.matcher(fragment);
              while (matcher.find()) {
                highlighter.addHighlight(it.getStartOffset() + matcher.start(),
                    it.getStartOffset() + matcher.end(), painter);
              }
            } catch (BadLocationException ex) {
            }
          }
        }
View Full Code Here

        // check if the actual string satisfies the specification
        if (matcher.find()) {
            // a match has been found, but we need to check that the whole event string
            // matches, and not just a substring
            if (!(matcher.start() == 0 && matcher.end() == eventString.length())) {
                // match on full eventString not found
                System.err
                                .println("event string invalid (proper substring matched): event string = "
                                                + eventString
                                                + ", specification = "
View Full Code Here

                                                + eventString
                                                + ", specification = "
                                                + spec
                                                + "matcher.start() "
                                                + matcher.start()
                                                + " matcher.end() " + matcher.end());
                return false;
            }
        } else {
            return false;
        }
View Full Code Here

            // special treatment for function keys
            if(!funcVisited)
            {
                final Matcher funcMatcher = FUNC_EXP.matcher(value);
                if(funcMatcher.find() && funcMatcher.start() == 0 && funcMatcher.end() == value.length())
                {
                    final int funcVal = Integer.parseInt(funcMatcher.group(2));

                    // SWT.F1 is (1 << 24) + 10
                    swtAccelerator = swtAccelerator | ((1 << 24) + (9 + funcVal));
View Full Code Here

    Matcher m = urlPattern.matcher(sb);
    int txtStart = 0;
    while(m.find())
    {
      int urlStart = m.start();
      int urlEnd = m.end();
      if(txtStart <= urlStart - 1)
        ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
      String linkText = sb.substring(urlStart, urlEnd);
      try
      {
View Full Code Here

    Matcher m = urlPattern.matcher(sb);
    int txtStart = 0;
    while(m.find())
    {
      int urlStart = m.start();
      int urlEnd = m.end();
      if(txtStart <= urlStart - 1)
        ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
      String linkText = sb.substring(urlStart, urlEnd);
      try
      {
View Full Code Here

    Matcher m = fontColorPattern.matcher(sb);
    int txtStart = 0;
    while(m.find())
    {
      int txtEnd = m.end();
      if(txtStart < txtEnd)
      {
        String text = sb.substring(txtStart, txtEnd);
        ret.add(new TextComponent(text, currentFont, currentColor));
      }
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.