From my CMC.
Given a regex and a non-empty printable ASCII text, return one bit per character in the text, indicating the positions of beginnings of non-overlapping matches, and also the positions of beginnings of sequences that are not part of any non-overlapping matches.
- take the regex as a regex object, string or any other way that is reasonable or allowed by default rules
- take the text as a string object, character list, or any other way that is reasonable or allowed by default rules
- return the bits as an array, integer, or any other way that is reasonable or allowed by default rules
You may use any flavour, library, or implementation for regexes, as long as you support:
- any-character wildcards, e.g.
- positive and negative character classes, e.g.
- repetitions, e.g.
a*and/or the general
- capturing groups, e.g.
- alternatives, e.g.
(you can take this as
(?:) if necessary)