--- title: findre linktitle: findRE description: Returns a list of strings that match the regular expression. godocref: date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 categories: [functions] tags: [regex] ns: signature: workson: [] hugoversion: relatedfuncs: [] deprecated: false aliases: [] --- Returns a list of strings that match the regular expression. By default all matches will be included. The number of matches can be limitted with an optional third parameter. The example below returns a list of all second level headers (`

`) in the content: ``` {{ findRE "(.|\n)*?

" .Content }} ``` You can limit the number of matches in the list with a third parameter. The following example shows how to limit the returned value to just one match (or none, if there are no matched substrings): ```golang {{ findRE "(.|\n)*?" .Content 1 }} ``` [partials]: /templates/partials/ [`plainify`]: /functions/plainify/ [toc]: /content-management/toc/ [`urlize`]: /functions/urlize