Examples of matchFirstSub()


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

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

    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

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

      for( int includeI = 0; includeI < numIncludes; includeI++ ) {
        includeMatch = allincludes[ includeI ];
        includeText  = includeMatch.match();

        includeFile = includeMatch.matchFirstSub();
        includeFile = ( null == includeFile ? Standard.EMPTY : includeFile );
        includeFile    
          = ( includeFile.startsWith( Standard.QUOTE ) && includeFile.endsWith( Standard.QUOTE ) )
          ? includeFile.substring( 1, includeFile.length()-1 ) : includeFile;
View Full Code Here

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

      numIncludeBlocks = allincludeblocks.length;

      for( int includeBlockI = 0; includeBlockI < numIncludeBlocks; includeBlockI++ ) {
        includeBlockMatch = allincludeblocks[ includeBlockI ];
        includeBlockText  = includeBlockMatch.match();
        includeBlockFile  = includeBlockMatch.matchFirstSub();
        includeBlockMark  = includeBlockMatch.matchSecondSub();

        RegExp markRegExp = RegExp.make( includeBlockMark, RegExp.ModeSet.DotMatchesNewline );

        // include the file block
View Full Code Here

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

        RegExpMatch conf      = null;
        String      props     = null;
        PropertySet propSet   = null;
        for( int confI = 0; confI < numConfs; confI++ ) {
          conf    = allconfs[ confI ];
          props   = conf.matchFirstSub();
          propSet = new PropertySet();
          propSet.parse( props );
          ps.overrideWith( propSet );
          foundConf = true;
        }
View Full Code Here

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

    // set default section to first argument, and put everything else into that section
    else {
      RegExpMatch match = doRegExpMatchArguments( pArguments );

      if( match.hasMatch() ) {
        String sectionName = match.matchFirstSub();
        String content     = match.matchSecondSub();

        pTemplateActionHandler.setDefaultSection( sectionName );

        // REVIEW: this is deprecated
View Full Code Here

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

  }

 
  protected String parseArguments( List pArgs, String pArguments ) {
    RegExpMatch match = sIncludeArgsRegExp.matchFirst( pArguments );
    String path = match.matchFirstSub();

    String arg = match.matchSecondSub();
    String[] args = arg.split("\\s");
    pArgs.addAll(Arrays.asList(args));
   
View Full Code Here

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

  private String removeExtraWhiteSpace( String pText ) throws RegExpException {
    String newText = pText;

    RegExpMatch prefix = sRemoveExtraWhiteSpacePrefixRegExp.matchFirst( newText );
    if( prefix.hasMatch() ) {
      newText = prefix.matchFirstSub();
    }

    RegExpMatch suffix = sRemoveExtraWhiteSpaceSuffixRegExp.matchFirst( newText );
    if( suffix.hasMatch() ) {
      newText = suffix.matchFirstSub();
View Full Code Here

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

      newText = prefix.matchFirstSub();
    }

    RegExpMatch suffix = sRemoveExtraWhiteSpaceSuffixRegExp.matchFirst( newText );
    if( suffix.hasMatch() ) {
      newText = suffix.matchFirstSub();
    }

    return newText;
  }
View Full Code Here

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

        RegExpMatch conf      = null;
        String      props     = null;
        PropertySet propSet   = null;
        for( int confI = 0; confI < numConfs; confI++ ) {
          conf    = allconfs[ confI ];
          props   = conf.matchFirstSub();
          propSet = new PropertySet();
          propSet.parse( props );
          ps.overrideWith( propSet );
          foundConf = true;
        }
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.