Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created December 23, 2011 21:54
Show Gist options
  • Save havenwood/1515462 to your computer and use it in GitHub Desktop.
Save havenwood/1515462 to your computer and use it in GitHub Desktop.
regex methods
class Parser
def split_pattern text
text.split(/(?:[^|]), /)
end
def match_escape_pattern text
text.match(/\|([,{}])/)
end
def replace_tricky_end_pattern text
text.gsub(/(?:[^|]), $/)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment