Recent Posts

Caution: Greetings to all visitors. The site is working in short. Links Please skip the link to view any topic and thank you for visiting
header ads

javascript regexp capture match index substring

In this example I want capture the fourth hide in S is hide3;

var S="gwrtgwhide0regwtrghide1erthgrthide2rtgbwtghide3ertghtrwhide4wertgerghide5ertghwrtghide6ewrtghwrtghide7wertgqew";

var j=/^((?:((?!hide\d).)*hide\d)){3}(?:((?!hide\d).)*(hide\d))/.exec(S);

console.log(j[j.length-1]);
Code (JavaScript):
I can to make a function for this in native javascript - ecmascript6


window["getIndexValue"]=(...a)=>{
     let string=a[0],substring=a[1],index=a[2];
     let R=new...
Code (JavaScript):
javascript regexp capture match index substring

from JavaScript https://ift.tt/3iG1jlb
via IFTTT

Post a Comment

0 Comments