@@ -190,7 +190,15 @@ module LiquidInterpolatable |
||
190 | 190 |
'concat(' << subs.join(', ') << ')' |
191 | 191 |
end |
192 | 192 |
end |
193 |
- |
|
193 |
+ |
|
194 |
+ def regex_replace(input, regex, replacement = ''.freeze) |
|
195 |
+ input.to_s.gsub(Regexp.new(regex), replacement.to_s) |
|
196 |
+ end |
|
197 |
+ |
|
198 |
+ def regex_replace_first(input, regex, replacement = ''.freeze) |
|
199 |
+ input.to_s.sub(Regexp.new(regex), replacement.to_s) |
|
200 |
+ end |
|
201 |
+ |
|
194 | 202 |
private |
195 | 203 |
|
196 | 204 |
def logger |