From: Joe Littlejohn Date: Fri, 2 Jun 2017 10:48:49 +0000 (+0100) Subject: Describe the options in README.md X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=df8061d77d511dff187e9a329347633723adb1fb;p=frak.git Describe the options in README.md --- diff --git a/README.md b/README.md index 118d3fc..dfadc21 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,14 @@ user> (frak/pattern ["skill" "skills" "skull" "skulls"]) #"sk(?:[ui]lls?)" ``` +## Options +Frak's `pattern` function can accept an options map as its second argument, the available options are: + +* `:capture?` - boolean (default false), whether rendered regex should create capture groups for each match +* `:escape-chars` - vector (default see [`frak/metacharacters`](https://github.com/noprompt/frak/blob/3c22d9b33646ca4bc681a5746ac0d11fd06e579b/src/cljx/frak.cljx#L54)), characters to escape when rendering a regular expression. +* `:exact?` - boolean (default false), whether the rendered regex should only produces matches when the entire input string matches. +* `:whole-words?` - boolean (default false), whether the rendered regex should match only whole words (word boundary at both ends of the match) in the input string. + ## Command line usage frak can be used from the command line with either Leiningen or NodeJS.