mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 18:44:52 -04:00
Add note on Golang regexp library to findRE and replaceRE funcs
This commit is contained in:
parent
6aaf47be8a
commit
8fb94fa4ae
@ -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
|
||||
|
||||
|
@ -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 %}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user