Java 8 Matcher - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Matcher class.

This code example shows how to use the following methods: group, matches
                } 
            } 
        } 
        version = prop.getProperty("atmosphere.version");
        Matcher matcher = versionPattern.matcher(version);
        if (matcher.matches()) {
            dotedVersion = matcher.group(1);
            major = Integer.parseInt(matcher.group(2));
            minor = Integer.parseInt(matcher.group(3));
            micro = Integer.parseInt(matcher.group(4));
        } else { 
            dotedVersion = "no.version";
            major = -1;
            minor = -1;
            micro = -1;
        } 
    } 
 
    /** 
     * Return the raw version derived frok the project's pom.xml 
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: group, matches
This code example shows how to use the following methods: group, matches
        if (text.isEmpty()) {
            throw new IllegalArgumentException("empty text");
        } 
 
        Matcher m = VERSION_PATTERN.matcher(text);
        if (!m.matches()) {
            throw new IllegalArgumentException("invalid version format: " + text);
        } 
 
        protocolName = m.group(1);
        majorVersion = Integer.parseInt(m.group(2));
        minorVersion = Integer.parseInt(m.group(3));
        this.text = protocolName + '/' + majorVersion + '.' + minorVersion;
        this.keepAliveDefault = keepAliveDefault;
        bytes = null;
    } 
 
    /** 
     * Creates a new HTTP version with the specified protocol name and version 
     * numbers.  You will not need to create a new instance unless you are 
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: find, group
      return; 
    } 
 
    String content = consume(response.getEntity());
    Matcher matcher = PRODUCT_NAME_PRICE_PATTERN.matcher(content);
    if (matcher.find()) {
      append(matcher.group(1));
      append(matcher.group(2));
    } 
    setLink(uri);
  } 
 
  private static String consume(HttpEntity entity) {
    Log.d(TAG, "Consuming entity");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    InputStream in = null;
    try { 
      in = entity.getContent();
      byte[] buffer = new byte[1024];
      int bytesRead;
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: group, matches
    } 
 
    @JsonCreator 
    public static Size parse(String size) {
        final Matcher matcher = SIZE_PATTERN.matcher(size);
        checkArgument(matcher.matches(), "Invalid size: " + size);
 
        final long count = Long.parseLong(matcher.group(1));
        final SizeUnit unit = SUFFIXES.get(matcher.group(2));
        if (unit == null) {
            throw new IllegalArgumentException("Invalid size: " + size + ". Wrong size unit");
        } 
 
        return new Size(count, unit);
    } 
 
    private final long count;
    private final SizeUnit unit;
 
    private Size(long count, SizeUnit unit) {
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Matcher Questions & Answers:

See Code Examples for Java 8 Matcher Methods: