Package java.util.regex

Examples of java.util.regex.Pattern.split()


    return ret;
  }
 
  private static List<Location> parsePoints(String points) {
    Pattern patt = Pattern.compile("[ ,\n\r\t]+");
    String[] toks = patt.split(points);
    Location[] ret = new Location[toks.length / 2];
    for (int i = 0; i < ret.length; i++) {
      int x = Integer.parseInt(toks[2 * i]);
      int y = Integer.parseInt(toks[2 * i + 1]);
      ret[i] = Location.create(x, y);
View Full Code Here


        addrs.add(parsedAddress);
        continue;
      }
       
      // interface name
      String[] ifaces = interfaceSplitter.split(currentAddress);

      NetworkInterface netInterface = null;
      try
      {
        netInterface = NetworkInterface.getByName(ifaces[0]);
View Full Code Here

  private static PartHashSet extractPartHashes(FileHash fileHash, String partHashsRawData) {
    PartHashSet partHashSet = null;
    if (partHashsRawData != null) {
      partHashSet = new PartHashSet(fileHash);
      Pattern p = Pattern.compile(":");
      String[] partHashArray = p.split(partHashsRawData);
      for(String partHash : partHashArray)
        partHashSet.add(Convert.hexStringToByte(partHash));
    }
    return partHashSet;
  }
View Full Code Here

          // empty entry list
          fireEvent(ureq, new EntriesChosenEvent(new ArrayList()));
          return;
        }
        Pattern p = Pattern.compile(",|;");
        List entries = Arrays.asList(p.split(res));
        if (entries.size() > 0) {
          fireEvent(ureq, new EntriesChosenEvent(entries));
        }
      }
    }
View Full Code Here

                checkNonRegexpFlags("split", flags);
                result = StringUtil.split(s, splitString,
                        (flags & RE_FLAG_CASE_INSENSITIVE) != 0);
            } else {
                Pattern pattern = getPattern(splitString, (int) flags);
                result = pattern.split(s);
            }
            return ObjectWrapper.DEFAULT_WRAPPER.wrap(result);
        }
    }
}
View Full Code Here

        dateString = dateString.substring(dateString.indexOf(39) + 1,
                dateString.lastIndexOf(39));
        p = Pattern.compile("[ ]");

        dateTime = p.split(dateString);
        p = Pattern.compile(datePatternSeparator);
        datePart = p.split(dateTime[0]);
        if (dateTime.length > 1) {
            p = Pattern.compile("[:]");
            timePart2 = p.split(dateTime[1]);
View Full Code Here

                dateString.lastIndexOf(39));
        p = Pattern.compile("[ ]");

        dateTime = p.split(dateString);
        p = Pattern.compile(datePatternSeparator);
        datePart = p.split(dateTime[0]);
        if (dateTime.length > 1) {
            p = Pattern.compile("[:]");
            timePart2 = p.split(dateTime[1]);
        }
       
View Full Code Here

        dateTime = p.split(dateString);
        p = Pattern.compile(datePatternSeparator);
        datePart = p.split(dateTime[0]);
        if (dateTime.length > 1) {
            p = Pattern.compile("[:]");
            timePart2 = p.split(dateTime[1]);
        }
       
        for (int i = 0; i < timePart2.length; i++) {
          timePart[i] = timePart2[i];
        }
View Full Code Here

   */
  private boolean findExpressionInMultiValue(String ex, String values, int type) {
    try {
      if (ex == null || values == null) return false;                      // empty params?
      Pattern multiValueSeparatorEx = Pattern.compile(",");
      String[] a = multiValueSeparatorEx.split(ex);                        // split on ,
      Pattern multiValueSeparatorValue = Pattern.compile(";");
      String[] b = multiValueSeparatorValue.split(values);                // split on ;
      if (a == null || (a.length == 1 && a[0] == "")) return false;        // empty array?
      if (b == null || (b.length == 1 && b[0] == "")) return false;        // empty array?
      if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
View Full Code Here

    try {
      if (ex == null || values == null) return false;                      // empty params?
      Pattern multiValueSeparatorEx = Pattern.compile(",");
      String[] a = multiValueSeparatorEx.split(ex);                        // split on ,
      Pattern multiValueSeparatorValue = Pattern.compile(";");
      String[] b = multiValueSeparatorValue.split(values);                // split on ;
      if (a == null || (a.length == 1 && a[0] == "")) return false;        // empty array?
      if (b == null || (b.length == 1 && b[0] == "")) return false;        // empty array?
      if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
        Tracing.logDebug("a: " + Arrays.toString(a), EvalAttributeFunction.class);
        Tracing.logDebug("b: " + Arrays.toString(b), EvalAttributeFunction.class);
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.