var reg = /e(.*?)e/g; var result; while((result = reg.exec(targetText)) !== null) { doSomethingWith(result); }