const regex = /^[A-Za-z0-9\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff ]*$/;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('^[A-Za-z0-9\\u00a9\\u00ae\\u2000-\\u3300\\ud83c\\ud000-\\udfff\\ud83d\\ud000-\\udfff\\ud83e\\ud000-\\udfff ]*$', '')
const str = `asfd34๐ ๐ ๐คฃ ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฅฐ ๐ ๐ ๐ ๐ ๐ค ๐คฉ ๐ค ๐คจ ๐ ๐ ๐ถ ๐ ๐ ๐ฃ ๐ฅ ๐ฎ ๐ค ๐ฏ ๐ช ๐ซ ๐ด ๐ ๐ ๐ ๐ ๐คค ๐ ๐ ๐ ๐ ๐ ๐ค ๐ฒ ๐ ๐ ๐ ๐ ๐ค ๐ข ๐ญ ๐ฆ ๐ง ๐จ ๐ฉ ๐คฏ ๐ฌ ๐ฐ ๐ฑ ๐ฅต ๐ฅถ ๐ณ ๐คช ๐ต ๐ก ๐ ๐คฌ ๐ท ๐ค ๐ค ๐คข ๐คฎ ๐คง ๐ ๐ค ๐คก ๐ฅณ ๐ฅด ๐ฅบ`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
if ((m = regex.exec(str)) !== null) {
// 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