[General boards] [Winter 2019 courses] [Fall 2018 courses] [Summer 2018 courses] [Older or newer terms]

Substrings that match regex


#1

write all substrings of a2bbc1cc2bb12b2c
regex is a.*[12]
Then do I need to write all six substrings : a2, a2bbc1, a2bbc1cc2, a2bbc1cc2bb1, a2bbc1cc2bb12, a2bbc1cc2bb12b2?


#2

That is correct. All 6 are substrings of the original string that match the regular expression.