Package org.apache.regexp

Examples of org.apache.regexp.RE.match()


      temp = TextUtils.replace(temp, ". ", ".");

      // Debug.debug("s1", s);
      RE re = new RE("^[\\w \\-]*\\.[\\w \\.\\-]*\\.(com|net|org|edu)$");
      // re.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
      if (re.match(temp.toLowerCase()))
        return null;

      // Debug.debug("s2", s);

      // if (new RE(
View Full Code Here


  {
    if (s == null)
      return null;

    RE re = new RE(pattern);
    if (re.match(s.toLowerCase()))
    {
      // Debug.debug("\t" + "featuring match(" + pattern + ")", s);
      // String wholeExpr = re.getParen(0);
      // Debug.debug("\t" + "wholeExpr", wholeExpr);
      // String insideParens = re.getParen(1);
View Full Code Here

      if (left.endsWith("("))
        left = left.substring(0, left.length() - 1);
      right = right.trim();

      RE re2 = new RE("(.*)(,.*)*\\&(.*)");
      if (re2.match(right))
      {
        Vector v = listToNames(re2);
        featured_artists.removeAll(v);
        featured_artists.addAll(v);
      } else
View Full Code Here

        featured_artists.removeAll(v);
        featured_artists.addAll(v);
      } else
      {
        re2 = new RE("(.*)(,.*)*\\ And (.*)");
        if (re2.match(right))
        {
          Vector v = listToNames(re2);
          featured_artists.removeAll(v);
          featured_artists.addAll(v);
        } else
View Full Code Here

      // Debug.debug("\t"+"pattern", pattern);

      RE re = REGEX_CACHE.getRegEx(pattern);
      // RE re = new RE(pattern.toLowerCase());
      // Debug.debug("prefix", prefix_pattern);
      if (!re.match(s.toLowerCase()))
        return s;
      // String match = re.getParen(0);
      // Debug.debug("match(" + pattern + ")", s);
      s = s.substring(0, re.getParenStart(0))
          + s.substring(re.getParenEnd(0));
View Full Code Here

    try
    {
      RE re = REGEX_CACHE.getRegEx(pattern);
      // RE re = new RE(pattern.toLowerCase());
      if (!re.match(s.toLowerCase()))
        return s;

      if (paren < re.getParenCount())
      {
        s = re.getParen(paren);
View Full Code Here

     * @return true if the specified input matches the regular expression regex.
     */
    public static boolean matches(String regex, String input)
        throws RESyntaxException {
        RE re = REUtil.createRE(regex);
        return re.match(input);
    }

    public static void assertMatches(String regex, String input) {
        try {
            if (!(matches(regex, input)))
View Full Code Here

     * @return true if the specified input matches the regular expression regex.
     */
    public static boolean matches(String regex, String input)
        throws RESyntaxException {
        RE re = REUtil.createRE(regex);
        return re.match(input);
    }

    public static void assertMatches(String regex, String input) {
        try {
            if (!(matches(regex, input)))
View Full Code Here

        if (match == null) {
            return null;
        }

        if (re.match(match)) {
            /* Handle parenthesised subexpressions. XXX: could be faster if we count
             * parens *outside* the generated code.
             * Note: *ONE* based, not zero, zero contains complete match
             */
            int parenCount = re.getParenCount();
View Full Code Here

            try {
                final RE reCorner = new RE(EDGE_GROUP);
                for (int r = 0; r < aa.getH(); r++) {
                    String row = aa.getRow(r);
                    int startIndex = 0;
                    while (reCorner.match(row, startIndex)) {
                        String s = reCorner.getParen(0);
                        int mStart = reCorner.getParenStart(0);
                        int mEnd = reCorner.getParenEnd(0);

                        if (s.equals("\\")) {
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.