Package org.apache.oro.text.regex

Examples of org.apache.oro.text.regex.Perl5Compiler.compile()


              lineToken[i] = myMatch.getMatch().toString();
              if (separator[i] != null) {
                //  Se il token aveva dei separatori li tolgo
                lineToken[i] = lineToken[i].substring(1, lineToken[i].length() - 1);
                //E prendo quello che mi interessa di cio che rimane
                if (myMatch.contains(lineToken[i], myComp.compile(regExp[i]))) {
                  lineToken[i] = myMatch.getMatch().toString();
                } else {
                  //Riga sbagliata, decremento il num di oss
                  countObs--;
View Full Code Here


        m_searchPath.add( DEFAULT_FORMS_PACKAGE );

        PatternCompiler compiler = new Perl5Compiler();

        try {
            m_pluginPattern = compiler.compile( PLUGIN_INSERT_PATTERN );
        } catch( MalformedPatternException e ) {
            log.fatal( "Internal error: someone messed with pluginmanager patterns.", e );
            throw new InternalWikiException( "PluginManager patterns are broken" );
        }
View Full Code Here

        if (splitElement != null) {
            String patternString = DomHelper.getAttribute(splitElement, "pattern");
            Perl5Compiler compiler = new Perl5Compiler();
            Pattern pattern;
            try {
                pattern = compiler.compile(patternString, Perl5Compiler.READ_ONLY_MASK);
            } catch (MalformedPatternException e) {
                throw new FormsException("Invalid regular expression '" + patternString + "'.",
                                         e, DomHelper.getLocationObject(splitElement));
            }
            definition.setSplitPattern(pattern, patternString);
View Full Code Here

        Assert.notNull(this.messages, "A message source must be set");

        Perl5Compiler compiler = new Perl5Compiler();

        try {
            subjectDNPattern = compiler.compile(subjectDNRegex,
                    Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK);
        } catch (MalformedPatternException mpe) {
            throw new IllegalArgumentException("Malformed regular expression: " + subjectDNRegex);
        }
    }
View Full Code Here

    public void addSecureUrl(String perl5RegExp, ConfigAttributeDefinition attr) {
        Pattern compiledPattern;
        Perl5Compiler compiler = new Perl5Compiler();

        try {
            compiledPattern = compiler.compile(perl5RegExp, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException mpe) {
            throw new IllegalArgumentException("Malformed regular expression: " + perl5RegExp);
        }

        requestMap.add(new EntryHolder(compiledPattern, attr));
View Full Code Here

        PatternCompiler compiler = new Perl5Compiler();

      try
      {
            _isoDatePattern = compiler.compile("'(\\d{4}\\-\\d{2}\\-\\d{2})'");
            _isoTimePattern = compiler.compile("'(\\d{2}:\\d{2}:\\d{2})'");
        }
      catch (MalformedPatternException ex)
        {
          throw new DdlUtilsException(ex);
View Full Code Here

        PatternCompiler compiler = new Perl5Compiler();

      try
      {
            _isoDatePattern = compiler.compile("'(\\d{4}\\-\\d{2}\\-\\d{2})'");
            _isoTimePattern = compiler.compile("'(\\d{2}:\\d{2}:\\d{2})'");
        }
      catch (MalformedPatternException ex)
        {
          throw new DdlUtilsException(ex);
        }
View Full Code Here

        Element splitElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "split", true);
        String patternString = DomHelper.getAttribute(splitElement, "pattern");
        Perl5Compiler compiler = new Perl5Compiler();
        Pattern pattern = null;
        try {
            pattern = compiler.compile(patternString, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException e) {
            throw new Exception("Invalid regular expression at " + DomHelper.getLocation(splitElement) + ": " + e.getMessage());
        }
        definition.setSplitPattern(pattern, patternString);
View Full Code Here

        buildFailMessage(validationRuleElement, rule);

        Perl5Compiler compiler = new Perl5Compiler();
        Pattern pattern = null;
        try {
            pattern = compiler.compile(regexp, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException e) {
            throw new Exception("Invalid regular expression at " + DomHelper.getLocation(validationRuleElement) + ": " + e.getMessage());
        }
        rule.setPattern(regexp, pattern);
View Full Code Here

  {
        PatternCompiler compiler = new Perl5Compiler();

        try
        {
            _datePattern = compiler.compile("(\\d{2,4})(?:\\-(\\d{2}))?(?:\\-(\\d{2}))?.*");
        }
        catch (MalformedPatternException ex)
        {
            throw new DdlUtilsException(ex);
        }
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.