Package java.util.regex

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


      } else {
        throw new IllegalArgumentException("valueSplit: " + valueRegex + " doesn't match " + str);
      }
      if (str.length() > 0) {
        Matcher sm = sPat.matcher(str);
        if (sm.lookingAt()) {
          str = str.substring(sm.end());
          // String got = sm.group();
          // System.err.println("smatched " + got + "; now str is " + str);
        } else {
          throw new IllegalArgumentException("valueSplit: " + separatorRegex + " doesn't match " + str);
View Full Code Here


      if(pathMatcher.lookingAt()) {
        pathsToData.add(new File(value));
        configuredOptions.add(ConfigParser.paramPath);
      }
      else if(mapMatcher.lookingAt()) {
        pathsToMappings.add(new File(value));
        configuredOptions.add(ConfigParser.paramMapping);
      }
      else if(param.equals(ConfigParser.paramEncode))
        encoding = Encoding.valueOf(value);
View Full Code Here

        private boolean isTempPath(String basePathName) throws DataStorageException {
            String tdir = pc.getProperties().getProperty("pig.temp.dir", "/tmp");
            String tempStore = pc.getDfs().asContainer(tdir + "/temp").toString();
            Matcher matcher = Pattern.compile(tempStore + "-?[0-9]+").matcher(basePathName);
            return matcher.lookingAt();
        }
    }

}
View Full Code Here

        int position = 0;
        Matcher m = rexp.matcher(st);
        OUTER: while (position < st.length())
        {
            m.region(position, st.length());
            if (m.lookingAt())
            {
                for (int i = 1; i <= m.groupCount(); i++)
                {
                    String value = m.group(i);
                    if (value != null)
View Full Code Here

        int position = 0;
        Matcher m = rexp.matcher(st);
        OUTER: while (position < st.length())
        {
            m.region(position, st.length());
            if (m.lookingAt())
            {
                for (int i = 1; i <= m.groupCount(); i++)
                {
                    String value = m.group(i);
                    if (value != null)
View Full Code Here

        final StringBuilder regex= new StringBuilder();
        final List<Strategy> collector = new ArrayList<Strategy>();

        final Matcher patternMatcher= formatPattern.matcher(pattern);
        if(!patternMatcher.lookingAt()) {
            throw new IllegalArgumentException(
                    "Illegal pattern character '" + pattern.charAt(patternMatcher.regionStart()) + "'");
        }

        currentFormatField= patternMatcher.group();
View Full Code Here

        currentFormatField= patternMatcher.group();
        Strategy currentStrategy= getStrategy(currentFormatField, definingCalendar);
        for(;;) {
            patternMatcher.region(patternMatcher.end(), patternMatcher.regionEnd());
            if(!patternMatcher.lookingAt()) {
                nextStrategy = null;
                break;
            }
            final String nextFormatField= patternMatcher.group();
            nextStrategy = getStrategy(nextFormatField, definingCalendar);
View Full Code Here

     */
    @Override
    public Date parse(final String source, final ParsePosition pos) {
        final int offset= pos.getIndex();
        final Matcher matcher= parsePattern.matcher(source.substring(offset));
        if(!matcher.lookingAt()) {
            return null;
        }
        // timing tests indicate getting new instance is 19% faster than cloning
        final Calendar cal= Calendar.getInstance(timeZone, locale);
        cal.clear();
View Full Code Here

    });
    sortedEntries.addAll(versions.entrySet());
    for (Map.Entry entry : sortedEntries) {
      String key = (String)entry.getKey();
      Matcher matcher = COORDINATE_KEY_PATTERN.matcher(key);
      if (matcher.lookingAt()) {
        String groupId = matcher.group(1);
        String artifactId = matcher.group(2);
        String coordinate = groupId + ':' + artifactId;
        String version = (String)entry.getValue();
        versionsMap.put(coordinate + ".version", version);
View Full Code Here

    try (InputStream stream = new FileInputStream(coordinatePropertiesFile);
         Reader reader = new InputStreamReader(stream, StandardCharsets.ISO_8859_1);
         BufferedReader bufferedReader = new BufferedReader(reader)) {
      while (null != (line = readLogicalPropertiesLine(bufferedReader))) {
        final Matcher keyMatcher = COORDINATE_KEY_PATTERN.matcher(line);
        if ( ! keyMatcher.lookingAt()) {
          continue; // Ignore keys that don't look like "/org/name"
        }
        currentKey = keyMatcher.group(1);
        if (null != previousKey) {
          int comparison = currentKey.compareTo(previousKey);
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.