const regex = /[幹乾淦贛干肏操糙去塞賽]?[林賃吝拎恁你他她它祂牠](娘|媽|老師|妹|祖?(嬤|媽|罵))(的|樂|叻|垃|勒|咧|([基唧雞機激][掰歪]))?|([基唧雞機激][掰歪])/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('[幹乾淦贛干肏操糙去塞賽]?[林賃吝拎恁你他她它祂牠](娘|媽|老師|妹|祖?(嬤|媽|罵))(的|樂|叻|垃|勒|咧|([基唧雞機激][掰歪]))?|([基唧雞機激][掰歪])', 'g')
const str = `幹
幹他媽的
幹你娘
乾
乾林老師
靠
靠北
靠杯
靠背
靠盃
靠腰
靠夭
哭夭
去你的
去你媽的
林北
恁北
恁娘
恁祖媽
機掰
賤
俗辣
他媽的
覽趴
懶趴
北爛
盧小
魯洨
色龜
肚爛
屌
啥小
三小
操
屁
唬爛
龜公
他奶奶的
犯賤
機車
智缺
你娘卡好
林老師
破麻
賽
操卒仔
操機歪
糙機掰
無懶趴
卡小
吃小
死魚眼
炭甲查某
糙你妹
GGININ
GG IN IN
GG IN IN DER
可惡 想揉
想揉
ㄈㄈ尺
英文原生:
CCR
Fuck off
Fuck
mother fucker
You SOB
son of a bitch
Go to hell
Shit-head
Asshole
You beast
Shit
fart
Idiot
damn it
God damn
God damn it
hypocrite
ass hole
ass licker
bitch
phycho
bastard
Whore
Slut
Shit-head
`;
// 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