stringi has no function that search within substring without memory creating it. This function solve that. Unlike count_substring_fixed, this function does not need to memory copy substring.
count_substring_regex(sequence, start, end, pattern)
A numeric vector of count.
A sequence to map.
Start positions.
End positions.
A regex pattern to search for within start and end positions.