irongit

A rust macro that allows regular expression creation through independent files. Allows fully typed named groups.

14 lines286 BRegular Expression
1# This will create a struct called EventRE with the fields start, end, ampm, and activity
2
3# Get the start
4^(?<start>\d{1,2}:\d{1,2})
5.
6# Get the end time
7(?<end>\d{1,2}:\d{1,2})
8\s{0,2}
9
10# Get the AM or PM after the times
11(?<ampm>[AMPM]{2})
12.
13# Get the activity string
14(?<activity>.+)