Package java.util.regex

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


    if (expandReferences && value != null && value.indexOf('}') > 0) {
      Matcher matcher;

      if (params != null) {
        matcher = PAT_PARAM_NUM.matcher(value);
        while (matcher.find()) {
          String key = matcher.group(1);
          try {
            int i = Integer.parseInt(key);

            if (i < params.length) {
View Full Code Here


          }
        }
      }

      matcher = PAT_PARAM_ALPHA.matcher(value);
      while (matcher.find()) {
        String key = matcher.group(1);
        String text = getValue(key, params);
        if (text == null) {
          text = MessageText.getString(key);
        }
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

    wrap = (swtFlags & SWT.WRAP) > 0;

    if (string.indexOf('<') >= 0) {
      if ((printFlags & FLAG_KEEP_URL_INFO) == 0) {
        Matcher htmlMatcher = patHREF.matcher(string);
        boolean hasURL = htmlMatcher.find();
        if (hasURL) {
          listUrlInfo = new ArrayList<URLInfo>(1);
 
          while (hasURL) {
            URLInfo urlInfo = new URLInfo();
View Full Code Here

            urlInfo.text = string.substring(htmlMatcher.start(2),
                htmlMatcher.end(2));
            urlInfo.titleLength = urlInfo.text.length();
 
            Matcher matcherTitle = patAHREF_TITLE.matcher(urlInfo.fullString);
            if (matcherTitle.find()) {
              urlInfo.title = string.substring(urlInfo.relStartPos
                  + matcherTitle.start(1), urlInfo.relStartPos
                  + matcherTitle.end(1));
            }
 
View Full Code Here

                  + matcherTitle.start(1), urlInfo.relStartPos
                  + matcherTitle.end(1));
            }
 
            Matcher matcherTarget = patAHREF_TARGET.matcher(urlInfo.fullString);
            if (matcherTarget.find()) {
              urlInfo.target = string.substring(urlInfo.relStartPos
                  + matcherTarget.start(1), urlInfo.relStartPos
                  + matcherTarget.end(1));
            }
 
View Full Code Here

    public static String replaceSystemProperties(String oldString) {
        Pattern p = Pattern.compile("\\$\\{[^\\}]*\\}");
        Matcher m = p.matcher(oldString);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            String pp = m.group();
            String rep = null;
            if (pp.length() > 3) {
                pp = pp.substring(2, pp.length() - 1);
                rep = System.getProperty(pp);
View Full Code Here

     */
    public static List<String> parseUniqueName(String uniqueName) {
        List<String> trail = new ArrayList<String>();
        Pattern regex = Pattern.compile("([^\\[\\]\\.]*)");
        Matcher matcher = regex.matcher(uniqueName);
        while (matcher.find()) {
            String match = matcher.group();
            if (!match.equals("")) {
                trail.add(match);
            }
        }
View Full Code Here

        for (final String logLine : log) {
            final String nextLogLine = logLine.trim();

            if (filterMatcher != null) {
              filterMatcher.reset(nextLogLine);
              if (!filterMatcher.find()) continue;
            }

            if (nextLogLine.startsWith("E ")) {
                level = 4;
            } else if (nextLogLine.startsWith("W ")) {
View Full Code Here

        match = 3;
      } else if ((c == 'B') && (match == 3)) {
        match = 4;
        //System.out.println( "hdr=" + hdr.toString() );
        Matcher m = productID.matcher(hdr.toString());
        if (m.find()) {
          header = m.group(1);
        } else {
          //header = hdr.toString();
          header = "GRIB2";
        }
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.