|
Java™ by example!
|
|
|
How do I write a Grep utility that makes uses of the RegEx package?
Here's a simple example that gets you started. It allows you to search a pattern (-cpat) in a set of files that match a certain regular expression (-fpat). You can specify a directory from where it should start searching with the option -root. -R tells the grepper to recurse through subdirectories. Below are a couple examples. Grep.java:
For example:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|