const regex = />.*</mg;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('>.*<', 'mg')
const str = `injaseong1949@gmail.com>, Isaac Kim <
ibkim4@hotmail.com>, Johnny Kim <
johnnykim317@gmail.com>, Kyeongok Kang <
sarahkang100b@yahoo.com>, Kyu Han <
peterkyuhan@yahoo.com>, Kyu Lee <
kyujlee1@gmail.com>, Tae in Kim <
tikim58@gmail.com>, Yong Choi <
yongskchoi@gmail.com>, 강지연님 크리스찬 타임즈 <
vidakang@gmail.com>, 강호재님 <
hojaekang@gmail.com>, 권순화님 <
shn0802@gmail.com>, 김신영님 <
kimsy810@gmail.com>, 김영주님 <
lydiatree@gmail.com>, 김유신 목사님 <
kgmbc@hotmail.com>, 남소연님 <
esthersoyoun@hotmail.com>, 민영미님 <
mym0130@hanmail.net>, 박용돈님 <
ruthswalve@gmail.com>, 박은경 집사님 <
love0528@gmail.com>, 박종구님 <
askdad0824@gmail.com>, 박찬일님 <
cip717@yahoo.com>, 박해명님 <
hlan12@aol.com>, 신광희님 <
ky309512@gmail.com>, 아틀란타 기독일보 <
atldaily@gmail.com>, 유경희님 <
khyouchoi@gmail.com>, 이강평님 <
kplee@scu.ac.kr>, 이근상 목사님 <
lee@mykoreanchurch.org>, 이무희 장로님 <
moohleemd@gmail.com>, 이숙자 전도사님 <
sookja37@gmail.com>, 이원 장로님 <
wonlee38@gmail.com>, 이은조 전도사님 <
eunjol@hotmail.com>, 이의윤님 <
euiyunlee@gmail.com>, 이주배 장로님 <
jbcommon@gmail.com>, 이지환님 <
jeefanlee@gmail.com>, 이창향님 <
leejamiex@gmail.com>, 장현덕 집사님 <
bokchang22@yahoo.com>, 조선미님 <
smc129@hanmail.net>, 최낙신 목사님 <
nakchoi@gmail.com>, 최병주님 <
1268bj@hanmail.net>, 최병주 목사님 <
cbjmission@gmail.com>, 최승혁 목사님 <
bryan.choe@gmail.com>, 탁종희님 <
takjoanna@gmail.com>, 황미란 전도사님 <
miransh2006@gmail.com> Choanna Kim <
choannakim@gmail.com>, Choong Kim
lwgmc38@yahoo.com>, hyung kim <
hyungkm2006@gmail.com>, Tony Kim <
tony@sntmotorsusa.com>, Yoon Kim <
yoonie008@gmail.com>, 권태동님 <
kwon.61@gmail.com>, 김동일님 <
ddongil1023@gmail.com>, 김용웅 목사님 <
nambukbc@gmail.com>, 김인저님 < `;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions