const regex = /me/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('me', 'gm')
const str = `https://lingojam.com/edit/02db819202047a0e482ab768cd7baec9
###name, Name of your translator...:
IRC Server Now Understands Voice
###subtitle, Subtitle (optional):
The Only Way
###language1, Language1 name...:
Antonio Rodriguez Jr. Command To Anything
###language2, Language2 name...:
Antonio Rodriguez Jr. Is Now Heard, Seen, Felt, Sense, And Vice Verca
###description, Description...:
import java.util.Scanner
Scanner stdin = new Scanner(System.in)
public class Command
{
public static void main(String[] args)
{
System.out.println("Command:");
}
###email, Admin email (optional)...:
wonderfulyanderful@gmail.com
###phrases1, Language1...:
###phrases2, Language2...:
###words1, Language1...:
###words2, Language2...:
###intraword1, Language1...:
###intraword2, Language2...:
###prefixes1, Language1...:
###prefixes2, Language2...:
###suffixes1, Language1...:
###suffixes2, Language2...:
###regex1, Replace this...:
###regex2, with this...:
###rev_regex1, Replace this...:
###rev_regex2, with this...:
###ordering1, Language1...:
###ordering2, Language2...:
###defaulttext, One random default text string per line...:
###disable-reverse, :
on
###custom-script, Define your functions here...:
###title-extra, e.g. '(and reverse translation)':
###background-image-source, http://example.com/my_image.png:
###title-font-name, Name of custom font...:
###title-font-size, Size of title (default=5.5)...:
###language1-font, Language1 font...:
###language2-font, Language2 font...:
###language1-font-size, Language1 font size (default=24)...:
###language2-font-size, Language2 font size (default=24)...:
`;
// 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