Java Reference
In-Depth Information
return
return ;
}
iif ( countOnly ) {
matches ++;
} else
else {
iif (! dontPrintFileName ) {
System . out . print ( fileName + ": " );
}
System . out . println ( inputLine );
}
} else
else iif ( inVert ) {
System . out . println ( inputLine );
}
}
iif ( countOnly )
System . out . println ( matches + " matches in " + fileName );
} catch
catch ( IOException e ) {
System . err . println ( e );
}
}
}
[ 17 ] Non-Unix fans fear not, for you can use tools like grep on Windows systems using one of several
packages. One is an open source package alternately called CygWin (after Cygnus Software) or
GnuWin32 . Another is Microsoft's findstr command for Windows. Or you can use my Grep program
in Printing Lines Containing a Pattern if you don't have grep on your system. Incidentally, the name
grep comes from an ancient Unix line editor command g/RE/p , the command to find the regex globally
in all lines in the edit buffer and print the lines that match—just what the grep program does to lines in
files.
[ 18 ] REDemo was inspired by (but does not use any code from) a similar program provided with the now-
retired Apache Jakarta Regular Expressions package.
[ 19 ] On Unix, the shell or command-line interpreter expands *.txt to all the matching filenames before
running the program, but the normal Java interpreter does this for you on systems where the shell isn't
energetic or bright enough to do it.
[ 20 ] Or a few related Unicode characters, including the next-line ( \u0085 ), line-separator ( \u2028 ), and
paragraph-separator ( \u2029 ) characters.
[ 21 ] You might think this would hold some kind of world record for complexity in regex competitions,
but I'm sure it's been outdone many times.
 
 
 
 
 
Search WWH ::




Custom Search