Regex JavaScript overlapping matches -


if have string fooba , want catch both foo , fooba how can do? if use foo|fooba cathes first foo , not fooba.

use lookaheads (zero-width assertion) both patterns:

(?=(foo))(?=(fooba)) 

regex demo


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -