Examples of group()


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

            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

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

    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

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

      String magnet = parseTextForMagnets(decodeString);
      if (magnet != null) {
        pattern = Pattern.compile("(.*)/[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

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

    Pattern pat = Pattern.compile("<.*a\\s++.*href=\"?([^\\'\"\\s>]++).*",
        Pattern.CASE_INSENSITIVE);
    Matcher m = pat.matcher(text);
    if (m.find()) {
      String sURL = m.group(1);
      try {
        sURL = URLDecoder.decode(sURL);
      } catch (Exception e) {
        // sometimes fires a IllegalArgumentException
        // catch everything and ignore.
View Full Code Here

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

          Matcher match = SET_STATEMENT.matcher(commands[0]);
          if (match.matches()) {
            if (resultsMode == ResultsMode.RESULTSET) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
            }
            String key = match.group(1);
            String value = match.group(2);
            if (ExecutionProperties.NEWINSTANCE.equalsIgnoreCase(key) && Boolean.valueOf(value)) {
              this.getMMConnection().getServerConnection().cleanUp();
            } else {
              JDBCURL.addNormalizedProperty(key, value, this.driverConnection.getExecutionProperties());
View Full Code Here

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

          if (match.matches()) {
            if (resultsMode == ResultsMode.RESULTSET) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
            }
            String key = match.group(1);
            String value = match.group(2);
            if (ExecutionProperties.NEWINSTANCE.equalsIgnoreCase(key) && Boolean.valueOf(value)) {
              this.getMMConnection().getServerConnection().cleanUp();
            } else {
              JDBCURL.addNormalizedProperty(key, value, this.driverConnection.getExecutionProperties());
            }
View Full Code Here

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

          if (match.matches()) {
          logger.finer("Executing as transaction statement"); //$NON-NLS-1$
            if (resultsMode == ResultsMode.RESULTSET) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
            }
            String command = match.group(1);
            Boolean commit = null;
            if (StringUtil.startsWithIgnoreCase(command, "start")) { //$NON-NLS-1$
              //TODO: this should force a start and through an exception if we're already in a txn
              this.getConnection().setAutoCommit(false);
            } else if (command.equalsIgnoreCase("commit")) { //$NON-NLS-1$
View Full Code Here

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

          if (match.matches()) {
          logger.finer("Executing as show statement"); //$NON-NLS-1$
            if (resultsMode == ResultsMode.UPDATECOUNT) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.show_update_count")); //$NON-NLS-1$
            }
            String show = match.group(1);
            if (show.equalsIgnoreCase("PLAN")) { //$NON-NLS-1$
              List<ArrayList<Object>> records = new ArrayList<ArrayList<Object>>(1);
              PlanNode plan = driverConnection.getCurrentPlanDescription();
              if (plan != null) {
                ArrayList<Object> row = new ArrayList<Object>(3);
View Full Code Here

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

            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));
                    displayValue.append(funcMatcher.group(0)).append(DELIM);
View Full Code Here

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

                {
                    final int funcVal = Integer.parseInt(funcMatcher.group(2));

                    // SWT.F1 is (1 << 24) + 10
                    swtAccelerator = swtAccelerator | ((1 << 24) + (9 + funcVal));
                    displayValue.append(funcMatcher.group(0)).append(DELIM);

                    funcVisited = true;
                    matched = true;
                }
            }
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.