is it possible to use regexes to extract data from a tag?
I want to get the trailing number from a tag to use as part of logic.
what I wanted to do was
puts "blah_blah_24"[/\d+$/]
my hacky work-around is
puts "blah_blah_24".reverse.to_i.to_s.reverse.to_i
the error I get when trying to use regex is
[Error] uninitialized constant Regex
I just looked this up myself, trying to use Regex in a Shopify Script, and found that it's not supported: https://help.shopify.com/en/manual/apps/apps-by-shopify/script-editor/limitations#regular-expression.... Best to find another method to use.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |