Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js iterate match indexes

const targetText = ''
let reg = /e(.*?)e/g;
let result;

while((result = reg.exec(targetText)) !== null) {
  	// result: ['', '', '', index: 210, input: '[targetText]', groups: undefined]
    doSomethingWith(result);
}
 
PREVIOUS NEXT
Tagged: #js #iterate #match #indexes
ADD COMMENT
Topic
Name
6+9 =