Package java.util.regex

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


    Pattern pattern = Pattern.compile(regex);

    Matcher matcher = pattern.matcher(value);

    while (matcher.find()) {
      String sysKey = matcher.group(1);
      String p = pre + sysKey + post;
      String v = sysKey.equalsIgnoreCase("user.appdata") ? System.getenv("appdata") : System.getProperty(sysKey,"UNKNOWN");
     
      // We habe to replace '\' and '$' signs before replacement
      // see: http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)
View Full Code Here


      String line=reader.readLine();

      while (line != null) {
        matcher=pluginTypePattern.matcher(line);
        if (matcher.find()) { // new plugin
          String type=matcher.group(1);
          String className=matcher.group(2);

          if ("plugin".equals(type)) {
            curItem=new PluginSoftwareUpdateItem(className);
          }
View Full Code Here

      while (line != null) {
        matcher=pluginTypePattern.matcher(line);
        if (matcher.find()) { // new plugin
          String type=matcher.group(1);
          String className=matcher.group(2);

          if ("plugin".equals(type)) {
            curItem=new PluginSoftwareUpdateItem(className);
          }
          else if ("dataservice".equals(type)) {
View Full Code Here

        }
        else {
          matcher=keyValuePattern.matcher(line);

          if (matcher.find()) { // new plugin
            String value = matcher.group(2);
            value = value.replaceAll("\\\\", ""); // fix wrong HTML encoding in plugin descriptions

            if(curItem != null) {
              curItem.addProperty(matcher.group(1), value);
            }
View Full Code Here

          if (matcher.find()) { // new plugin
            String value = matcher.group(2);
            value = value.replaceAll("\\\\", ""); // fix wrong HTML encoding in plugin descriptions

            if(curItem != null) {
              curItem.addProperty(matcher.group(1), value);
            }
          }
        }
        line=reader.readLine();
      }
View Full Code Here

      if (m[i].getName().equals("getClass")) continue;
      if (m[i].getParameterTypes().length > 0) continue;
      Matcher r = p.matcher(m[i].getName());
      if (r.matches()) {
        try {
          values.put(r.group(1).toLowerCase(), m[i].invoke(bean, new Object[0]));
        } catch (IllegalArgumentException e) {
          throw e;
        } catch (IllegalAccessException e) {
          throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
View Full Code Here

    Matcher matcher;

    pattern = Pattern.compile("bc://bt/([a-z0-9=\\+/]+)", Pattern.CASE_INSENSITIVE);
    matcher = pattern.matcher(text.replaceAll(" ", "+"));
    if (matcher.find()) {
      String base64 = matcher.group(1);
      byte[] decode = Base64.decode(base64);
      if (decode != null && decode.length > 0) {
        // Format is AA/<name>/<size>/<hash>/ZZ
        try {
          String decodeString = new String(decode, "utf8");
View Full Code Here

        try {
          String decodeString = new String(decode, "utf8");
          pattern = Pattern.compile("AA.*/(.*)/ZZ", Pattern.CASE_INSENSITIVE);
          matcher = pattern.matcher(decodeString);
          if (matcher.find()) {
            String hash = matcher.group(1);
            String magnet = parseTextForMagnets(hash);
            if (magnet != null) {
              pattern = Pattern.compile("AA/(.*)/[0-9]+", Pattern.CASE_INSENSITIVE);
              matcher = pattern.matcher(decodeString);
              if (matcher.find()) {
View Full Code Here

            String magnet = parseTextForMagnets(hash);
            if (magnet != null) {
              pattern = Pattern.compile("AA/(.*)/[0-9]+", Pattern.CASE_INSENSITIVE);
              matcher = pattern.matcher(decodeString);
              if (matcher.find()) {
                String name = matcher.group(1);
                return magnet + "&dn=" + encode(name);
              }
              return magnet;
            }
          }
View Full Code Here

    pattern = Pattern.compile("bctp://task/(.*)", Pattern.CASE_INSENSITIVE);
    matcher = pattern.matcher(text);
    if (matcher.find()) {
      // Format is <name>/<size>/<hash>
      String decodeString = matcher.group(1);
      String magnet = parseTextForMagnets(decodeString);
      if (magnet != null) {
        pattern = Pattern.compile("(.*)/[0-9]+", Pattern.CASE_INSENSITIVE);
        matcher = pattern.matcher(decodeString);
        if (matcher.find()) {
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.