Liking cljdoc? Tell your friends :D

Build Status Open Issues License Dependencies Status

multigrep

A little Clojure library that provides regex-based file grepping and/or text substitution.

Installation

multigrep is available as a Maven artifact from Clojars. Plonk the following in your project.clj :dependencies, lein deps and you should be good to go:

[org.clojars.pmonks/multigrep "#.#.#"]

The latest version is:

version

Trying it Out

Alternatively, you may prefer to kick the library's tyres without creating a project. This is a snap with the awesome lein try plugin:

$ lein try org.clojars.pmonks/multigrep

Or (as of v0.4.0), if you have done a brew install clojure you can simply

$ clj -Sdeps '{:deps {org.clojars.pmonks/spinner {:mvn/version "#.#.#"}}}'  # Where #.#.# is replaced with an actual version number >= 0.4.0

Either way, you will be dropped in a REPL with the library downloaded and ready for use.

Usage

The multigrep functionality is provided by the multigrep.core namespace.

Require it in the REPL:

(require '[multigrep.core :as mg])

Require it in your application:

(ns my-app.core
  (:require [multigrep.core :as mg]))

The library provides two functions - grep (for searching for text within files) and (since v0.3.0) greplace! (for searching and replacing text within files). The API documentation has full details, and the unit tests have comprehensive examples.

Tested Versions

multigrep is tested on:

JVM v1.6JVM v1.7JVM v1.8JVM v9JVM v10JVM v11
Clojure 1.4.01,211111
Clojure 1.5.12
Clojure 1.6.02
Clojure 1.7.02
Clojure 1.8.02
Clojure 1.9.02
Clojure 1.10.0 (snapshot)2,33

1 I chose to only go back as far as Clojure v1.5.1. If anyone needs this on older versions, PRs are welcome!

2 Leiningen v2.8 only supports JVM v1.7 and up

3 Clojure v1.10 only supports JVM v1.8 and up

Contributors

Erik Assum - edumucated me in the use of partial.

Developer Information

GitHub project

Bug Tracker

License

Copyright © 2014 Peter Monks (pmonks@gmail.com)

Distributed under the Eclipse Public License either version 2.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close