in reply to Re: Match Optional Groups with 1 Required Group
in thread Match Optional Groups with 1 Required Group
Using the split function is exactly what I was going to suggest after having read your original post since it is particularly appropriate for text chunks delimited by separators (although a capturing regex can of course also do it, as shown in the posts below). As a side note, have a look at predefined character classes, such as \w, which can save you quite a bit of typing and make your regexes easier to read and understand.