Added regex look-ahead assertion for correct match counting.