Created
December 11, 2013 10:42
-
-
Save ichistmeinname/7908336 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition des regulären Ausdrucks | |
uhrzeitRegexp = /(2[0-3]|[0-1]?[0-9]):[0-5][0-9]/; | |
# Zeichenkette aus Datei "zeitplan.txt" auslesen | |
text = IO.read("zeitplan.txt"); | |
# Matche meinen regulären Ausdruck mit `text`, | |
# gebe alle Vorkommen aus und betrachte Reststring | |
# für weiteres Matching | |
while text.=~(uhrzeitRegexp) != nil do | |
# wenn wir nichts matchen, ist `nil` der Rückgabewert | |
# sonst die Indexposition des Anfangs | |
# Gebe gematchten String ggf. aus | |
puts($&); | |
# Binde den Reststring an alte(!) Variable | |
text = $'; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7:00 Begruessung | |
09:17 Fruehstueck | |
10:37 Vortrag bis ca. 11:30 | |
12:00 Mittagessen | |
13:15 Verdauungsspaziergang | |
15:09 Noch mehr Vortraege bis ca. 18:15 | |
19:53 Handball schauen, Wunschergebnis 37:33 | |
ab 22:00 gemeinsam singen | |
24:00 Feuerwerk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment