Package java.util.regex

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


              }
            }
            result += pstrSourceString.substring(index, intStart) + strRepl;
          }
        }
        index = m.end(i);
      }
      result += pstrSourceString.substring(index);
    }

    return result;
View Full Code Here


    Pattern WIKI_LINK_PATTERN = Pattern.compile("\\[\\[[^\\]]*[^\\]]*\\]\\]");
    Matcher m = WIKI_LINK_PATTERN.matcher(content);
    List links = new ArrayList();
 
    while(m.find()) {
      String link = content.substring(m.start(), m.end());
      if (!link.startsWith("[[Image:") && !link.startsWith("[[Media:") &&
          (link.indexOf("http://") == -1) && (link.indexOf('&') != -1) ) {
        testOut("Migrate ampersand in: "+link);
        links.add(link); // no image, link has '&'
      }
View Full Code Here

    Pattern WIKI_LINK_PATTERN = Pattern.compile("\\[\\[[^\\]]*[^\\]]*\\]\\]");
    Matcher m = WIKI_LINK_PATTERN.matcher(content);
    List links = new ArrayList();
 
    while(m.find()) {
      String link = content.substring(m.start(), m.end());
      if (!link.startsWith("[[Image:") && !link.startsWith("[[Media:") &&
          (link.indexOf("http://") == -1) && (link.indexOf(':') != -1) ) {
        testOut("Migrate colon in: "+link);
        links.add(link); // no image, link has ':'
      }
View Full Code Here

    Pattern WIKI_LINK_PATTERN = Pattern.compile("\\[\\[[^\\]]*Image:[^\\]]*\\]\\]");
    Matcher m = WIKI_LINK_PATTERN.matcher(content);
    List links = new ArrayList();
 
    while(m.find()) {
      String link = content.substring(m.start(), m.end());
      if (!link.endsWith("|right]]") && !link.endsWith("|left]]") && !link.endsWith("|center]]") )  {
        testOut("ImageTag to be replaced: "+link);
        links.add(link);
      }
    }
View Full Code Here

    Matcher m = WIKI_LINK_PATTERN.matcher(content);
 
    List links = new ArrayList();
 
    while(m.find()) {
      String link = content.substring(m.start(), m.end());
      if (!link.startsWith("[[Image:") && !link.startsWith("[[Media:") && (link.indexOf('"') != -1) ) {
        testOut("Migrate DoubleQuote in: "+link);
        // no image and link with doubleQuote
        // check for '|' => [[link|text]] extract link
        if (link.indexOf('|') != -1) {
View Full Code Here

    Matcher m = WIKI_LINK_PATTERN.matcher(content);
 
    List links = new ArrayList();
 
    while(m.find()) {
      String link = content.substring(m.start(), m.end());
      if (!link.startsWith("[[Image:") && !link.startsWith("[[Media:") && (link.indexOf("?") != -1) ) {
        testOut("Migrate Questionmark in: "+link);
        // no image and link with doubleQuote
        // check for '|' => [[link|text]] extract link
        if (link.indexOf('|') != -1) {
View Full Code Here

              }
            }
            result += pstrSourceString.substring(index, intStart) + strRepl;
          }
        }
        index = m.end(i);
      }
      result += pstrSourceString.substring(index);
    }

    return result;
View Full Code Here

    if (replacements.length < intGroupCount)
      throw new JobSchedulerException("replacements missing: " + replacements.length + " replacement(s) defined but " + intGroupCount + " groups found");

    // no groups, exchange the whole string
    if (intGroupCount == 0) {
      result = pstrSourceString.substring(0, m.start()) + replacements[0] + pstrSourceString.substring(m.end());
    }
    else {
      int index = 0;
      // m.matches();
View Full Code Here

          String translation;
         
          try {
            Matcher matcher = pattern.matcher(key);
            if(matcher.find()) {
              String pos = key.substring(matcher.start(), matcher.end());
              if(matcher.find()) {
                String pos2 = key.substring(matcher.start(), matcher.end());
                key = key.replace(pos + ".", "").replace(pos2 + ".", "");
                translation = translator.translate(key, new String[]{pos,pos2});
              }
View Full Code Here

          try {
            Matcher matcher = pattern.matcher(key);
            if(matcher.find()) {
              String pos = key.substring(matcher.start(), matcher.end());
              if(matcher.find()) {
                String pos2 = key.substring(matcher.start(), matcher.end());
                key = key.replace(pos + ".", "").replace(pos2 + ".", "");
                translation = translator.translate(key, new String[]{pos,pos2});
              }
              else {
                key = key.replace(pos + ".", "");
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.