Package org.jostraca.util

Examples of org.jostraca.util.RegExp.matchFirstSub()



  public void doMatchRegExpTests( RegExpProvider pREP ) throws Exception {
    RegExp re01 = pREP.make( "a(.*?)c" );
    assertEquals( "abc",  re01.match( "abcc" ) );
    assertEquals( "b",    re01.matchFirstSub( "abcc" ) );

    RegExp re02 = pREP.make( "\\$a" );
    assertEquals( "$a",  re02.match( "$ab" ) );

    RegExp re03 = pREP.make( "a.b.", new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
View Full Code Here


    RegExp re03 = pREP.make( "a.b.", new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
    assertEquals( "a\nb\n",  re03.match( "ca\nb\n" ) );

    RegExp re04 = pREP.make( "^[ \\t]*\\n(.*)", new RegExp.ModeSet( RegExp.Mode.DotMatchesNewline ) );
    assertEquals( "b\n",  re04.matchFirstSub( "\nb\n" ) );
  }


  public void doMatchAllTests( RegExpProvider pREP ) throws Exception {
    RegExp      re01 = pREP.make( "a(.)\n" );
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.