Package java.util.regex

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


          String fieldValue = String.valueOf(rowData.get(currentIndex - 1));

          if (fieldValue != null) {
            Pattern pattern = Pattern.compile("[^a-zA-z_0-9 ]");
            Matcher fieldMatch = pattern.matcher(fieldValue);
            fieldValue = fieldMatch.replaceAll("");
            // fieldValue = fieldValue.replaceAll("'","");
          }

          if (fieldValue == null || fieldValue.equals("null")) {
            fieldValue = "";
View Full Code Here


        Pattern log_pattern = Pattern.compile(detect_matcher.group(1));
        Matcher log_matcher = log_pattern.matcher(last_log);
        String result = null;
        if ("g".equals(detect_matcher.group(3)))
        {
          result = log_matcher.replaceAll(detect_matcher.group(2));
        }
        else
        {
          result = log_matcher.replaceFirst(detect_matcher.group(2));
        }
View Full Code Here

    if(input != null) {
      for(int i = 0 ; i < fieldRemappings.length ; i++) {
        if(fieldRemappings[i].getMatch() != null && fieldRemappings[i].getReplacement() != null) {
          Matcher matcher = fieldRemappings[i].getMatch().matcher(input);
          if(matcher.matches()) {
            output = matcher.replaceAll(fieldRemappings[i].getReplacement());
            i = fieldRemappings.length;
          }
        }
      }
    }
View Full Code Here

            calendar.add(Calendar.DATE, -1);
          } else {
            //We're in the real "ago" case, let's remove " ago" if it's there
            s = s.replaceAll("ago","").trim();
            matcher = agoSpacerPattern.matcher(s);
            s = matcher.replaceAll("$1 $2");
            matcher = agoTimeRangePattern.matcher(s);
            boolean seenHoursAsLowerCaseH = false;
            while(matcher.find()) {
              String unit = matcher.group(2);
             
View Full Code Here

      }
     
      encoded_message = convertUrl(encoded_message, URL_HIGHLIGHT);

      Matcher email_matcher = EMAIL_HIGHLIGHT.matcher(encoded_message);
      encoded_message = email_matcher.replaceAll("<a href=\"mailto:$1\">$1</a>");

      mTemplate.setValue("message", encoded_message);

      mTemplate.appendBlock("messages", "message");
View Full Code Here

          }
         
          encoded_message = ChannelLog.convertUrl(encoded_message, ChannelLog.URL_HIGHLIGHT);

          Matcher email_matcher = ChannelLog.EMAIL_HIGHLIGHT.matcher(encoded_message);
          encoded_message = email_matcher.replaceAll("<a href=\"mailto:$1\">$1</a>");

          mTemplate.setValue("nickname", nickname);
          mTemplate.setValue("message", encoded_message);

          mTemplate.appendBlock("messages", "message");
View Full Code Here

        s = removeValuesBetween("(", ")", s);
        s = removeValuesBetween("[", "]", s);

        for (int i = 0; i < normalizer.length; i++) {
            Matcher ma = normalizer[i].matcher(s);
            s = ma.replaceAll(" ");
        }
       
        s = s.replaceAll("\n", "");
        s = s.replaceAll("\r", "");
       
View Full Code Here

            String regex = DcModules.get(getModule()).getSettings().getString(DcRepository.ModuleSettings.stTitleCleanupRegex);
            if (!Utilities.isEmpty(regex)) {
                Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
                Matcher matcher = pattern.matcher(name);
                while (matcher.find())
                    name = matcher.replaceAll("");
            }
        }
       
        return StringUtils.capitalize(name.trim());
    }   
View Full Code Here

            hasURL = htmlMatcher.find(urlInfo.relStartPos);
          }
        }
      } else {
        Matcher htmlMatcher = patHREF.matcher(string);
        string = htmlMatcher.replaceAll("$2");
      }
    }

    Rectangle rectDraw = new Rectangle(printArea.x, printArea.y,
        printArea.width, printArea.height);
View Full Code Here

          hasURL = htmlMatcher.find(urlInfo.relStartPos);
        }
      }
    } else {
      Matcher htmlMatcher = patHREF.matcher(string);
      string = htmlMatcher.replaceAll("$2");
    }

    Rectangle rectDraw = new Rectangle(printArea.x, printArea.y,
        printArea.width, printArea.height);
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.