Examples of RegularExpression


Examples of com.bleujin.framework.valid.validator.RegularExpression

   
  }
 
 
  public void testRegularExpression() throws Exception {
    assertEquals(false, new RegularExpression(b, SVALIE, "").isValid()) ;
   
    b.setSvalue("abc") ;
    assertEquals(true, new RegularExpression(b, SVALIE, "^[a-c]+$").isValid()) ;
    assertEquals(false, new RegularExpression(b, SVALIE, "^[b-c]+$").isValid()) ;
  }
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression

        if ((presentFacet & FACET_PATTERN) != 0) {
            if ((allowedFacet & FACET_PATTERN) == 0) {
                reportError("cos-applicable-facets", new Object[]{"pattern", fTypeName});
            } else {
                patternAnnotations = facets.patternAnnotations;
                RegularExpression regex = null;
                try {
                    regex = new RegularExpression(facets.pattern, "X");
                } catch (ParseException e) {
                    reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage(), new Integer(e.getLocation())});
                }
                if (regex != null) {
                    fPattern = new Vector();
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression

      nvalue = normalize(content, fWhiteSpace);
    } else {
      nvalue = content.toString();
    }
    if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
      RegularExpression regex;
      for (int idx = fPattern.size()-1; idx >= 0; idx--) {
        regex = (RegularExpression)fPattern.elementAt(idx);
        if (!regex.matches(nvalue)){
          throw new InvalidDatatypeValueException("cvc-pattern-valid",
              new Object[]{content,
              fPatternStr.elementAt(idx),
             
              fTypeName});
View Full Code Here

Examples of mf.org.apache.xerces.impl.xpath.regex.RegularExpression

        if ((presentFacet & FACET_PATTERN) != 0) {
            if ((allowedFacet & FACET_PATTERN) == 0) {
                reportError("cos-applicable-facets", new Object[]{"pattern", fTypeName});
            } else {
                patternAnnotations = facets.patternAnnotations;
                RegularExpression regex = null;
                try {
                    regex = new RegularExpression(facets.pattern, "X", context.getLocale());
                } catch (Exception e) {
                    reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
                }
                if (regex != null) {
                    fPattern = new Vector();
View Full Code Here

Examples of mf.org.apache.xerces.impl.xpath.regex.RegularExpression

            nvalue = normalize(content, fWhiteSpace);
        } else {
            nvalue = content.toString();
        }
        if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
            RegularExpression regex;
            for (int idx = fPattern.size()-1; idx >= 0; idx--) {
                regex = (RegularExpression)fPattern.elementAt(idx);
                if (!regex.matches(nvalue)){
                    throw new InvalidDatatypeValueException("cvc-pattern-valid",
                            new Object[]{content,
                            fPatternStr.elementAt(idx),

                            fTypeName});
View Full Code Here

Examples of net.sf.saxon.regex.RegularExpression

     */

    private RegexIterator getRegexIterator(XPathContext context) throws XPathException {
        CharSequence input = select.evaluateAsString(context);

        RegularExpression re = pattern;
        if (re == null) {
            CharSequence flagstr = flags.evaluateAsString(context);
            final Platform platform = Configuration.getPlatform();
            final int xmlVersion = context.getConfiguration().getXMLVersion();
            int flagBits = JRegularExpression.setFlags(flagstr);
            re = new JRegularExpression(regex.evaluateAsString(context), xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);  
            if (re.matches("")) {
                dynamicError("The regular expression must not be one that matches a zero-length string",
                        "XTDE1150", context);
            }
        }

        return re.analyze(input);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

    public void setMatch(String match) {
        if (regex != null) {
            throw new BuildException("Only one regular expression is allowed");
        }

        regex = new RegularExpression();
        regex.setPattern(match);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

    public RegularExpression createRegexp() {
        if (regex != null) {
            throw new BuildException("Only one regular expression is allowed.");
        }

        regex = new RegularExpression();
        return regex;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

            if (line == null) {
                ch = -1;
            } 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.types.RegularExpression

        Parameter[] params = getParameters();
        if (params != null) {
            for (int i = 0; i < params.length; i++) {
                if (REGEXP_KEY.equals(params[i].getType())) {
                    String pattern = params[i].getValue();
                    RegularExpression regexp = new RegularExpression();
                    regexp.setPattern(pattern);
                    regexps.addElement(regexp);
                }
            }
        }
    }
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.