Package railo.runtime.functions.string

Source Code of railo.runtime.functions.string.REMatchNoCase

/**
* Implements the CFML Function refind
*/
package railo.runtime.functions.string;

import org.apache.oro.text.regex.MalformedPatternException;

import railo.runtime.PageContext;
import railo.runtime.exp.ExpressionException;
import railo.runtime.exp.FunctionException;
import railo.runtime.ext.function.Function;
import railo.runtime.regex.Perl5Util;
import railo.runtime.type.Array;

public final class REMatchNoCase implements Function {
 
  public static Array call(PageContext pc , String regExpr, String str) throws ExpressionException {
    try {
      return Perl5Util.match(regExpr, str, 1, false);
    }
    catch (MalformedPatternException e) {
      throw new FunctionException(pc,"REMatchNoCase",1,"regularExpression",e.getMessage());
    }
  }
}
TOP

Related Classes of railo.runtime.functions.string.REMatchNoCase

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.