diff options
author | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-18 12:07:31 -0500 |
---|---|---|
committer | Flaviu Tamas <tamasflaviu@gmail.com> | 2015-01-18 12:07:31 -0500 |
commit | d407282e357e1d649e884b24df00a1d959b10d20 (patch) | |
tree | 8960aaf2d1bdb9bc030ab3246d4686eceafa8df1 | |
parent | c70a9932b909cc773ff4778f75dacca98a56c722 (diff) | |
download | Nim-d407282e357e1d649e884b24df00a1d959b10d20.tar.gz |
Change readme formatting
-rw-r--r-- | README.asciidoc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/README.asciidoc b/README.asciidoc index 702e6cc6b..67454e445 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -21,10 +21,10 @@ provides in its standard library is inadequate: == Documentation -=== Procedures +=== Operations [[proc-match]] -==== `match(string, Regex, start = 0, endpos = -1): RegexMatch` +==== match(string, Regex, start = 0, endpos = -1): RegexMatch Tries to match the pattern, starting at start. This means that `"foo".match(re"f") == true`, but `"foo".match(re"o") == false`. @@ -35,14 +35,14 @@ Tries to match the pattern, starting at start. This means that otherwise it's an exclusive upper bound. [[proc-find]] -==== `find(string, Regex, start = 0, endpos = -1): RegexMatch` +==== find(string, Regex, start = 0, endpos = -1): RegexMatch Finds the given pattern in the string. Bounds work the same as for link:#proc-match[`match(...)`], but instead of being anchored to the start of the string, it can match at any point between `start` and `endpos`. [[iter-find]] -==== `findIter(string, Regex, start = 0, endpos = -1): RegexMatch` +==== findIter(string, Regex, start = 0, endpos = -1): RegexMatch Works the same as link:#proc-find[`find(...)`], but finds every non-overlapping match. `"2222".find(re"22")` is `"22", "22"`, not `"22", "22", "22"`. @@ -55,7 +55,7 @@ Variants: - `findAllStr(...)` returns a `seq[string]` [[proc-split]] -==== `split(string, Regex): seq[string]` +==== split(string, Regex): seq[string] Splits the string with the given regex. This works according to the rules that Perl and Javascript use. @@ -66,7 +66,7 @@ Perl and Javascript use. `"12".split(re"(\d)") == @["", "1", "", "2", ""]`. [[proc-replace]] -==== `replace(string, Regex, sub): string` +==== replace(string, Regex, sub): string Replaces each match of Regex in the string with `sub`. @@ -77,7 +77,7 @@ If `sub` is a string, then each match is replaced with that string, where the captures are accessable as `$1`, `$2`, and so on. A literal `$` can be added by doubling up like so: `$$`. -=== `RegexMatch` +=== RegexMatch Represents the result of an execution. On failure, it is `nil`. The available fields are as follows: @@ -104,7 +104,7 @@ is inclusive. as a key. `(captureBounds|capture).toSeq` :: returns all the captures by their number. -=== `Pattern` +=== Pattern Represents the pattern that things are matched against, constructed with `initRegex(string)` or `re(string)`. Examples: `re"foo"`, `re(r"foo # comment", |