Examples of PatternMatcherInput


Examples of org.apache.oro.text.regex.PatternMatcherInput

     */
    @Override
    public Iterator<URL> getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls) {

        Perl5Matcher matcher = JMeterUtils.getMatcher();
        PatternMatcherInput input = localInput.get();
        // TODO: find a way to avoid the cost of creating a String here --
        // probably a new PatternMatcherInput working on a byte[] would do
        // better.
        input.setInput(new String(html)); // TODO - charset?
        Pattern pattern=JMeterUtils.getPatternCache().getPattern(
                REGEXP,
                Perl5Compiler.CASE_INSENSITIVE_MASK
                | Perl5Compiler.SINGLELINE_MASK
                | Perl5Compiler.READ_ONLY_MASK);
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

    public static void extractStyleURLs(final URL baseUrl, final URLCollection urls, String styleTagStr) {
        Perl5Matcher matcher = JMeterUtils.getMatcher();
        Pattern pattern = JMeterUtils.getPatternCache().getPattern(
                "URL\\(\\s*('|\")(.*)('|\")\\s*\\)", // $NON-NLS-1$
                Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.SINGLELINE_MASK | Perl5Compiler.READ_ONLY_MASK);
        PatternMatcherInput input = null;
        input = new PatternMatcherInput(styleTagStr);
        while (matcher.contains(input, pattern)) {
            MatchResult match = matcher.getMatch();
            // The value is in the second group
            String styleUrl = match.group(2);
            urls.addURL(styleUrl, baseUrl);
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

        Perl5Matcher localMatcher = JMeterUtils.getMatcher();
        // The headers and body are divided by a blank line (the \r is to allow for the CR before LF)
        String regularExpression = "^\\r$"; // $NON-NLS-1$
        Pattern pattern = JMeterUtils.getPattern(regularExpression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.MULTILINE_MASK);

        PatternMatcherInput input = new PatternMatcherInput(stringToCheck);
        if(localMatcher.contains(input, pattern)) {
            MatchResult match = localMatcher.getMatch();
            return match.beginOffset(0);
        }
        // No divider was found
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

     */
    public Iterator getEmbeddedResourceURLs(byte[] html, URL baseUrl, URLCollection urls)
    {

        Perl5Matcher matcher= (Perl5Matcher)localMatcher.get();
        PatternMatcherInput input= (PatternMatcherInput)localInput.get();
        // TODO: find a way to avoid the cost of creating a String here --
        // probably a new PatternMatcherInput working on a byte[] would do
        // better.
        input.setInput(new String(html));
        while (matcher.contains(input, pattern))
        {
            MatchResult match= matcher.getMatch();
            String s;
            if (log.isDebugEnabled())
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

    int matchNumber = getMatchNumber();

        vars.put(refName, getDefaultValue());
       
        Perl5Matcher matcher = (Perl5Matcher) localMatcher.get();
        PatternMatcherInput input =
            new PatternMatcherInput(
                useHeaders() ? context.getPreviousResult().getResponseHeaders()
                                 : new String(context.getPreviousResult().getResponseData())
        );
        log.debug("Regex = " + getRegex());
    try {
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

                "\\$(\\d+)\\$",
                Perl5Compiler.READ_ONLY_MASK & Perl5Compiler.SINGLELINE_MASK);
        log.debug("Pattern = " + templatePattern);
        log.debug("template = " + rawTemplate);
        Util.split(pieces, matcher, templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        Iterator iter = pieces.iterator();
        boolean startsWith = isFirstElementGroup(rawTemplate);
        log.debug(
            "template split into "
                + pieces.size()
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

        List collectAllMatches = new ArrayList();
        try
        {
            PatternMatcher matcher = (PatternMatcher) localMatcher.get();
            String responseText = new String(previousResult.getResponseData());
            PatternMatcherInput input = new PatternMatcherInput(responseText);
            while (matcher.contains(input, searchPattern))
            {
                MatchResult match = matcher.getMatch();
                collectAllMatches.add(match);
            }
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

    {
        List pieces = new ArrayList();
        List combined = new LinkedList();
        PatternMatcher matcher = new Perl5Matcher();
        Util.split(pieces, new Perl5Matcher(), templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        Iterator iter = pieces.iterator();
        boolean startsWith = isFirstElementGroup(rawTemplate);
        while (iter.hasNext())
        {
            boolean matchExists = matcher.contains(input, templatePattern);
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

        List collectAllMatches = new ArrayList();
        try
        {
            PatternMatcher matcher = (PatternMatcher) localMatcher.get();
            String responseText = new String(previousResult.getResponseData());
            PatternMatcherInput input = new PatternMatcherInput(responseText);
            while (matcher.contains(input, searchPattern))
            {
                MatchResult match = matcher.getMatch();
                collectAllMatches.add(match);
            }
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcherInput

    {
        List pieces = new ArrayList();
        List combined = new LinkedList();
        PatternMatcher matcher = new Perl5Matcher();
        Util.split(pieces, new Perl5Matcher(), templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        Iterator iter = pieces.iterator();
        boolean startsWith = isFirstElementGroup(rawTemplate);
        while (iter.hasNext())
        {
            boolean matchExists = matcher.contains(input, templatePattern);
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.