Examples of Regexp


Examples of org.apache.tools.ant.util.regexp.Regexp

            } else {
                final int regexpsSize = regexps.size();
                for (int i = 0; i < regexpsSize; i++) {
                    RegularExpression regexp = (RegularExpression)
                                                        regexps.elementAt(i);
                    Regexp re = regexp.getRegexp(getProject());
                    boolean matches = re.matches(line);
                    if (!matches) {
                        line = null;
                        break;
                    }
                }
View Full Code Here

Examples of org.apache.tools.ant.util.regexp.Regexp

    protected String doReplace(RegularExpression r,
                               Substitution s,
                               String input,
                               int options) {
        String res = input;
        Regexp regexp = r.getRegexp(project);

        if (regexp.matches(input, options)) {
            res = regexp.substitute(input, s.getExpression(project), options);
        }

        return res;
    }
View Full Code Here

Examples of org.jostraca.util.RegExp

        includeBlockMatch = allincludeblocks[ includeBlockI ];
        includeBlockText  = includeBlockMatch.match();
        includeBlockFile  = includeBlockMatch.matchFirstSub();
        includeBlockMark  = includeBlockMatch.matchSecondSub();

        RegExp markRegExp = RegExp.make( includeBlockMark, RegExp.ModeSet.DotMatchesNewline );

        // include the file block
        String  includeFileContent  = FileUtil.readFile( pIncludeBase + File.separatorChar + includeBlockFile );       
        String  includeBlockContent = markRegExp.match( includeFileContent );

        // very important - prevent data loss
        if( Standard.EMPTY.equals( includeBlockContent ) ) {
          throw new TemplateException( TemplateException.CODE_includeblock_find,
                                       new ValueSet( ValueCode.FILE, includeBlockFile, ValueCode.VALUE, includeBlockMark ) );
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Regexp

    public Operand buildDRegexp(DRegexpNode dregexpNode, IRScope s) {
        List<Operand> strPieces = new ArrayList<Operand>();
        for (Node n : dregexpNode.childNodes())
            strPieces.add(build(n, s));

        return new Regexp(new CompoundString(strPieces), dregexpNode.getOptions());
    }
View Full Code Here

Examples of org.jruby.ir.operands.Regexp

        List<Operand> strPieces = new ArrayList<Operand>();
        for (Node n : dregexpNode.childNodes()) {
            strPieces.add(dynamicPiece(n, s));
        }

        return copyAndReturnValue(s, new Regexp(new CompoundString(strPieces), dregexpNode.getOptions()));
    }
View Full Code Here

Examples of org.springmodules.validation.bean.conf.loader.annotation.handler.RegExp

        super(RegExp.class);
    }

    @Override
    public String convertToValang(String fieldName, Annotation a, MessageSourceAccessor messages) {
        RegExp annotation = (RegExp) a;

        String errMsg = messages.getMessage(annotation.errorCode(), annotation.message());
        String applyIfValang = valangToJS(annotation.applyIf());
        StringBuffer sb = new StringBuffer();

        sb.append(" function() {return this.equals((this.RegExFunction(");
        sb.append(wrapAndEscapeJsString(annotation.value())); // regex
        sb.append(",this.getPropertyValue(");
        sb.append(wrapAndEscapeJsString(fieldName)); // value name
        sb.append("))), (true))}");

        return buildBasicRule(fieldName, errMsg, sb.toString(), applyIfValang, a);
View Full Code Here

Examples of org.stjs.javascript.RegExp

import org.stjs.javascript.RegExp;

public class GlobalScope5 {
  public void test() {
    replace("a", new RegExp("abc"), "a" + "b" + "c");
  }
View Full Code Here

Examples of sun.misc.Regexp

    }

    @Test
    @SuppressWarnings("deprecation")
    public void shouldDistinguishByRegexpMatchInBody() {
        Condition condition = Condition.withPostBodyContaining(new Regexp("[0-9]+"));

        when(call.getPostBody()).thenReturn("331102");
        assertTrue(condition.check(call));

        condition = Condition.withPostBodyContaining(new Regexp("[a-z]+"));
        assertFalse(condition.check(call));
    }
View Full Code Here

Examples of sun.misc.Regexp

        Condition condition = Condition.withPostBodyContaining(Pattern.compile("[0-9]+"));

        when(call.getPostBody()).thenReturn("331102");
        assertTrue(condition.check(call));

        condition = Condition.withPostBodyContaining(new Regexp("[a-z]+"));
        assertFalse(condition.check(call));
    }
View Full Code Here

Examples of sunlabs.brazil.util.regexp.Regexp

  mustExist = props.getProperty(propsPrefix + EXIST) != null;
  persist = props.getProperty(propsPrefix + PERSIST) != null;
  session = props.getProperty(propsPrefix + PROPERTY, session);
  urlPrefix = props.getProperty(propsPrefix + URLPREFIX, "/");

  cookie = new Regexp("(^|; *)" + cookieName + "=([^;]*)");
        return true;
    }
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.