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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -