regex

jeremy16
New Member
9 0 0

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

0 Likes
jeremy16
New Member
9 0 0

hey @Shopify - it sure would be nice if you had developers MORE involved in this forum.

#1, move topics that don't belong to the appropriate channel

#2, actually answer people trying to use the software within 24 hours when it's a legitimate question

0 Likes
JØhn
Excursionist
37 5 9

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.

0 Likes