Examples of Regex


Examples of cli.System.Text.RegularExpressions.Regex

            throws XPathException {
        String translated = "";
        try {
            if (syntax == NATIVE_SYNTAX) {
                groupCount = 9;
                pattern = new Regex(regex.toString(), setFlags(flags));
            } else {
                DotNetRegexTranslator translator = new DotNetRegexTranslator();
                translated = translator.translate(
                        regex, xmlVersion, syntax==XPATH_SYNTAX, isIgnoreWhitespace(flags), isCaseBlind(flags));
                groupCount = translator.getNumberOfCapturedGroups();
                pattern = new Regex(translated, setFlags(flags));
            }
            //noinspection ConstantIfStatement
            if (false) {
                // to keep the compiler happy
                throw new ArgumentException();
View Full Code Here

Examples of com.codecademy.eventhub.storage.filter.Regex

            eventFilters, TrueFilter.INSTANCE));
    Assert.assertArrayEquals(new int[] {2, 0, 0},
        eventHub.getFunnelCounts(DATES[0], DATES[4], funnelSteps, 7 /* numDaysToCompleteFunnel */,
            Lists.<Filter>newArrayList(
                new ExactMatch("foo1", "bar1"),
                new Regex("foo4", Pattern.compile("b.*4")),
                TrueFilter.INSTANCE),
            TrueFilter.INSTANCE));
    Assert.assertArrayEquals(new int[] { 2, 2, 0 },
        eventHub.getFunnelCounts(DATES[0], DATES[4], funnelSteps, 7 /* numDaysToCompleteFunnel */,
            Lists.<Filter>newArrayList(
                new ExactMatch("foo2", "bar2"),
                new Regex("foo2", Pattern.compile("bar2")),
                new ExactMatch("foo2", "bar2")),
            TrueFilter.INSTANCE));
    Assert.assertArrayEquals(new int[] {2, 2, 2},
        eventHub.getFunnelCounts(DATES[0], DATES[4], funnelSteps, 7 /* numDaysToCompleteFunnel */,
            eventFilters, new ExactMatch("foo2", "bar2")));
View Full Code Here

Examples of com.stevesoft.pat.Regex

    protected void pClassClose() {
        np("}").pn();
    }

    private static String toNonGeneric(String type) {
        Regex regex = new Regex("(?@<>)", "");
        return regex.replaceAll(type);
    }
View Full Code Here

Examples of it.halfone.regex.Regex

     
      Matcher matcher = pattern.matcher(token);
      if(retVal = matcher.find()){
        token = token.replaceFirst(TokenParser.ID + "([\\d]+)\\|" + TokenParser.ID + "([\\d]+)", TokenParser.ID + index);
       
        Regex a = regexList.get(Integer.parseInt(matcher.group(1)));
      Regex b = regexList.get(Integer.parseInt(matcher.group(2)));
      regexList.add(a.or(b));
     
      ctx.setValue("token", token);
      ctx.setValue("index", ++index);
      }
View Full Code Here

Examples of joshua.util.Regex

      logger.info("Reading grammar from file " + grammar_file);
   
    boolean start = false;
    int order = 0;
   
    Regex blankLine  = new Regex("^\\s*$");
    Regex ngramsLine = new Regex("^\\\\\\d-grams:\\s*$");
   
    LineReader grammarReader = new LineReader(grammar_file);
    try { for (String line : grammarReader) {
      line = line.trim();
      if (blankLine.matches(line)) {
        continue;
      }
      if (ngramsLine.matches(line)) { // \1-grams:
        start = true;
        order = Integer.parseInt(line.substring(1, 2));
        if (order > ngramOrder) {
          break;
        }
View Full Code Here

Examples of net.sourceforge.cobertura.ant.Regex

        this.regexes.add( regex );
    }

    public Regex createRegex()
    {
        Regex regex = new Regex();
        this.regexes.add( regex );
        return regex;
    }
View Full Code Here

Examples of net.sourceforge.cobertura.ant.Regex

        check = new ConfigCheck();
    }

    public void testAddRegex()
    {
        Regex regex = new Regex();

        check.addRegex( regex );

        Set regexes = check.getRegexes();
View Full Code Here

Examples of org.apache.isis.applib.annotation.RegEx

    public void process(final ProcessMethodContext processMethodContext) {
        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
        if (!Annotations.isString(returnType)) {
            return;
        }
        final RegEx annotation = Annotations.getAnnotation(processMethodContext.getMethod(), RegEx.class);
        addRegexFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation);
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.RegEx

        super(FeatureType.OBJECTS_ONLY);
    }

    @Override
    public void process(final ProcessClassContext processClassContaxt) {
        final RegEx annotation = Annotations.getAnnotation(processClassContaxt.getCls(), RegEx.class);
        FacetUtil.addFacet(createRegexFacet(annotation, processClassContaxt.getFacetHolder()));
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.RegEx

        }

        final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
        for (final Annotation parameterAnnotation : parameterAnnotations) {
            if (parameterAnnotation instanceof RegEx) {
                final RegEx annotation = (RegEx) parameterAnnotation;
                addRegexFacetAndCorrespondingTitleFacet(processParameterContext.getFacetHolder(), annotation);
                return;
            }
        }
    }
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.