Package java.util.regex

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


        }

        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();
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();
View Full Code Here

        Matcher startMatcher = this.startPattern.matcher(input);

        // find the start of the searched tags
        if (startMatcher.find()) {
            Matcher endMatcher = this.endPattern.matcher(input);
            endMatcher = endMatcher.region(startMatcher.start(), input.length());

            // find the end of the list
            if (endMatcher.find()) {
                Matcher contentMatcher = this.contentPattern.matcher(input);
                contentMatcher = contentMatcher.region(startMatcher.start(), endMatcher.start());
View Full Code Here

            endMatcher = endMatcher.region(startMatcher.start(), input.length());

            // find the end of the list
            if (endMatcher.find()) {
                Matcher contentMatcher = this.contentPattern.matcher(input);
                contentMatcher = contentMatcher.region(startMatcher.start(), endMatcher.start());
                List<String> results = new ArrayList<String>();

                // add the found tag to the list
                while (contentMatcher.find()) {
                    String partialResult = contentMatcher.group().trim();
View Full Code Here

    public void testRegionsIntInt() {
        Pattern p = Pattern.compile("x*");
        Matcher m = p.matcher("axxxxxa");
        assertFalse(m.matches());
       
        m.region(1, 6);
        assertEquals(1, m.regionStart());
        assertEquals(6, m.regionEnd());
        assertTrue(m.matches());
       
        try {
View Full Code Here

        assertEquals(1, m.regionStart());
        assertEquals(6, m.regionEnd());
        assertTrue(m.matches());
       
        try {
            m.region(1, 0);
            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
View Full Code Here

            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
            m.region(-1, 2);
            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
View Full Code Here

            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
            m.region(10, 11);
            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
View Full Code Here

            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
       
        try {
            m.region(1, 10);
            fail("expected an IOOBE");
        } catch(IndexOutOfBoundsException e) {
        }
    }
   
View Full Code Here

    public void testMatchesRegionChanged() {
        // Regression for HARMONY-610
        String input = " word ";
        Pattern pattern = Pattern.compile("\\w+");
        Matcher matcher = pattern.matcher(input);
        matcher.region(1, 5);
        assertTrue(matcher.matches());
    }

    public void testAllCodePoints() {
        // Regression for HARMONY-3145
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.