overlapping-matches

C# multiple string match

I need C# string search algorithm which can match multiple occurance of pattern. For example, if pattern is 'AA' and string is 'BAAABBB' Regex produce match result Index = 1, but I need result Index = 1,2. Can I force Regex to give such result? ...

Regex split into overlapping strings

I'm exploring the power of regular expressions, so I'm just wondering if something like this is possible: public class StringSplit { public static void main(String args[]) { System.out.println( java.util.Arrays.deepToString( "12345".split(INSERT_REGEX_HERE) ) ); // prints "[12,...

MySQL range date overlap check

This table is used to store sessions CREATE TABLE session ( id int(11) NOT NULL AUTO_INCREMENT , start_date date , end_date date ); INSERT INTO session (start_date, end_date) VALUES ("2010-01-01", "2010-01-10") , ("2010-01-20", "2010-01-30") , ("2010-02-01", "2010-02-15") ; We don't want to have conflict between ranges Let's sa...

Overlapping matches with finditer() in Python

Hi there, I'm using a regex to match Bible verse references in a text. The current regex is REF_REGEX = re.compile(''' (?<!\w) # Not preceded by any words (?P<quote>q(?:uote)?\s+)? # Match optional 'q' or 'quote' followed by many spaces (?P<book> (?:(?:[1-3]|I{1,3})\s*)?...