Add note on Golang regexp library to findRE and replaceRE funcs

This commit is contained in:
Ryan Watters 2017-04-21 13:01:19 -05:00
parent 6aaf47be8a
commit 8fb94fa4ae
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,10 @@ You can limit the number of matches in the list with a third parameter. The foll
<!-- returns ["<h2 id="#foo">Foo</h2>"] -->
```
{{% note %}}
Hugo uses Golang's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
{{% /note %}}
<!-- Removed per request of @bep: https://github.com/spf13/hugo/issues/3188 -->
<!-- ## `findRE` Example: Building a Table of Contents

View File

@ -23,3 +23,7 @@ Replaces all occurrences of a regular expression with the replacement pattern.
{{ replaceRE "^https?://([^/]+).*" "$1" "http://gohugo.io/docs" }}` → "gohugo.io"
{{ "http://gohugo.io/docs" | replaceRE "^https?://([^/]+).*" "$1" }}` → "gohugo.io"
```
{{% note %}}
Hugo uses Golang's [Regular Expression package](https://golang.org/pkg/regexp/), which is the same general syntax used by Perl, Python, and other languages but with a few minor differences for those coming from a background in PCRE. For a full syntax listing, see the [GitHub wiki for re2](https://github.com/google/re2/wiki/Syntax).
{{% /note %}}