i have a string with optional substrings and i was looking/working for/on regular expression with names captures, a single regular expression for all if possible.
in RUBY
Please help,
sample strings:
string1 = bike wash #a simple task
string2 = bike wash @ bike point # a simple task with location
string3 = bike wash @ bike point on 13 may 11 # task with location and date
string4 = bike wash @ bike point on 13 may 11 @ 10 AM # task with location, date and time
string5 = bike wash on 13 may 11 @ 10 AM # task with date and time without location
string6 = bike wash on 13 may 11 # task and date
i have spent almost a day in google and stackoverflow to get a single regular expression for all the above pattern of strings.