Package org.renjin.primitives.text.regex

Examples of org.renjin.primitives.text.regex.RE


                           boolean ignoreCase,
                           boolean perl,
                           boolean fixed,
                           boolean useBytes) {
   
    RE re = REFactory.compile(pattern, ignoreCase, perl, fixed, useBytes);
    return  re.subst(x, replacement, ExtendedRE.REPLACE_FIRSTONLY | ExtendedRE.REPLACE_BACKREFERENCES );
  }
View Full Code Here


                            boolean ignoreCase,
                            boolean perl,
                            boolean fixed,
                            boolean useBytes) {

    RE re = REFactory.compile(pattern, ignoreCase, perl, fixed, useBytes);
    return re.subst(x, replacement, ExtendedRE.REPLACE_ALL | ExtendedRE.REPLACE_BACKREFERENCES );
  }
View Full Code Here

  public static StringVector strsplit(@Recycle String x, @Recycle String split,
                                      boolean fixed,
                                      boolean perl,
                                      boolean useBytes) {

    RE re = REFactory.compile(split, false, perl, fixed, useBytes);
    return new StringArrayVector( re.split(x) );
  }
View Full Code Here

      boolean perl,
      boolean fixed,
      boolean useBytes,
      boolean invert) {

    RE re = REFactory.compile(pattern,ignoreCase, perl, fixed, useBytes);
    if(value) {
      StringVector.Builder result = new StringVector.Builder();
      for(String string : x) {
        if(re.match(string)) {
          result.add(string);
        }
      }
      return result.build();
    } else {

      IntArrayVector.Builder result = new IntArrayVector.Builder(0);
      for(int i=0;i!=x.length();++i) {
        if(re.match(x.getElementAsString(i))) {
          result.add(i+1);
        }
      }
      return result.build();
    }
View Full Code Here

      boolean perl,
      boolean fixed,
      boolean useBytes,
      boolean invert) {

    RE re = REFactory.compile(pattern, ignoreCase,  perl, fixed, useBytes);
    LogicalArrayVector.Builder result = new LogicalArrayVector.Builder();
    for(String string : x) {
      result.add( ! StringVector.isNA(string) && re.match(string ));
    }
    return result.build();
  }
View Full Code Here

  @Internal
  public static IntVector regexpr(String pattern, StringVector vector, boolean ignoreCase, boolean perl,
      boolean fixed, boolean useBytes) {
   
    RE re = REFactory.compile(pattern, ignoreCase,  perl, fixed, useBytes);
    IntArrayVector.Builder position = IntArrayVector.Builder.withInitialCapacity(vector.length());
    IntArrayVector.Builder matchLength = IntArrayVector.Builder.withInitialCapacity(vector.length());
   
    for(String text : vector) {
      if(re.match(text)) {
        int start = re.getGroupStart(0);
        int end = re.getGroupEnd(0);
        position.add(start+1);
        matchLength.add(end-start);
      } else {
        position.add(-1);
        matchLength.add(-1);
View Full Code Here

TOP

Related Classes of org.renjin.primitives.text.regex.RE

Copyright © 2018 www.massapicom. 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.