Skip to content

Instantly share code, notes, and snippets.

@dramsay
Created February 11, 2020 14:14
Show Gist options
  • Save dramsay/70f3953c24413c3632515f7eac1a20fc to your computer and use it in GitHub Desktop.
Save dramsay/70f3953c24413c3632515f7eac1a20fc to your computer and use it in GitHub Desktop.
Formatting segment targets
def format_segments(segment_string)
groups = segment_string.split(/\)\(/)
groups.map do |group|
group.scan(/\d+/).join(',')
end.join(')(').prepend('(') << ')'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment