Is there any good, simple Java Grep Library? I’m not opposed to native code, or scripting, and I’ll do it, but for my purposes, throughput is not a huge deal, and it would be nice to have it all in one tidy package.
UPDATE: Sorry. I know about java.regex, I just happen to be fairly busy and tired right now. What I’m looking for is something that efficiently combines java regex with going through a set of files and rewriting them. This wouldn’t be too hard to write, I admit. I was just curious if that exists already.
I’m not aware of a sophisticated grep librarystrong text, but you are right: it’s not hard to write.I suggest a combination of
commons-ioandString.matches(someRegex):Update Marco pointed out
Unix4jwhich is a quite interesting library which emulates the unix pipelining|with Java method chaining.grepis supported as well ascat, cd, cut, echo, find, grep, head, ls, sed, sort, tail, uniq, wc, barges.