/ Published in: Ruby
URL: http://www.regular-expressions.info/ruby.html
don't forget to include parentheses around the expressions you want to match
Expand |
Embed | Plain Text
str = "Q1-1947" str =~ /Q(\d)-(\d{4})/ # prints "1" puts $1 # prints "1947" puts $2
You need to login to post a comment.
