1 2 3 4
/^(?:(\d)[ \-\.]?)?(?:\(?(\d{3})\)?[ \-\.])?(\d{3})[ \-\.](\d{4})(?: ?x?(\d+))?$/ # expanded version w/ comments ...
Ruby Phone number regex
by Lex,
October 31, 2008 16:00,
3 refactorings, tagged with phone number, regex, regexp, regular expression
1 2 3 4
res = [] path_without_calculation.gsub(/\{(.*?)\}/) {|match| res << match[1.. match.size-2] ...
Ruby Extract text between {} bra...
Can this be written shorten?
1 2 3 4
def writefile(file, *linedata) linedata.each do |line| file << line.join(",") + "\n" ...
Ruby Parsing non-delimited text
I have large text-reports f...
I wrote this regex for pars...