Lava Filters - RegExMatchValues
Category:Text
Description:Tests the input against a
Regular Expression and returns an
array of the matching substrings. If no match is made, it will return an empty array.
Input:
Lava: {% capture expression %}\b\w+day\b{% endcapture %}
{% assign days = "Services on Saturday and Sunday" | RegExMatchValues: expression %}
Found {{ days | Size }} matches:
{% for day in days %}
{{ day }}
{% endfor %}
Output: Found 2 matches: Saturday Sunday