June 2012
Intermediate to advanced
136 pages
2h 50m
German
#Suche nach Spider-Man, Spiderman, SPIDER-MAN usw.
dailybugle = 'Spider-Man Menaces City!'
if dailybugle.match(/spider[- ]?man./i)
puts dailybugle
end#Datumsangaben in Formaten wie MM/DD/YYYY, MM-DD-YY, ...
date = '12/30/1969'
regexp = Regexp.new('^(\d\d)[-/](\d\d)[-/](\d\d(?:\d\d)?)$')
if md = regexp.match(date)
month = md[1] #12
day = md[2] #30
year = md[3] #1969
end#<br> XHTML-konform in <br /> umwandeln text = 'Hello Welt. <br>'
regexp = Regexp.new('<br>', Regexp::IGNORECASE)
result = text.sub(regexp, "<br />")#urlify - URLs in HTML umwandeln text = 'Besuchen Sie die Website ' \ 'http://www.oreilly.de/catalog/regexpprger/.' regexp ...
Read now
Unlock full access