Package org.renjin.primitives.text.regex

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


                                       final boolean includeDirs) throws IOException {

    return new Object() {

      private final StringVector.Builder result = new StringVector.Builder();
      private final RE filter = pattern == null ? null : new ExtendedRE(pattern).ignoreCase(ignoreCase);

      public StringVector list() throws IOException {
        for(String path : paths) {
          FileObject folder = context.resolveFile(path);
          if(folder.getType() == FileType.FOLDER) {
View Full Code Here


    }
  }

  @Override
  public void exportPattern(String pattern) {
    ExtendedRE re = new ExtendedRE(pattern);
    for(Symbol symbol : namespace.getNamespaceEnvironment().getSymbolNames()) {
      if(re.match(symbol.getPrintName())) {
        namespace.addExport(symbol);
      }
    }
  }
View Full Code Here

public class RETest {

  @Test
  public void posixClasses() {
    // R regexps use double brackets for posix character classes
    assertTrue( new ExtendedRE("^[[:digit:]]+$").match("1249234") );
  }
View Full Code Here

  @Test
  public void dashInCharacterClass() {

    // in these cases, R treats the hyphen as a literal
    assertTrue( new ExtendedRE("^[a-]+$").match("a-a--aa---a-aaa") );
    assertTrue( new ExtendedRE("^[-a]+$").match("a-a--aa---a-aaa") );
    assertTrue( new ExtendedRE("^[-3]+$").match("3-3-333---3") );
    assertFalse(new ExtendedRE("^[-3]+$").match("23"));

    // make sure that normal character ranges still work
    assertTrue(new ExtendedRE("^[a-z4]+$").match("qf444ee"));
  }
View Full Code Here

TOP

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

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.