Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
regexp-cjk
Advanced tools
Generate JavaScript-compatible regular expressions with chinese/jp/zh/cn
Generate JavaScript-compatible regular expressions with chinese/jp/zh/cn
npm install regexp-cjk
version 2.x
allow use regexp event do something u need.
remove useless double pattern
sort pattern class
auto match cjk hanzi/chinese
human pattern class char range [一-十]
=> [一二三四五六七八九十]
import zhRegExp from 'regexp-cjk';
import { zhRegExp, create, isRegExp } from 'regexp-cjk';
new zhRegExp(string);
new zhRegExp(RegExp);
[
/EARTH|亞斯\(アース\)/ig,
'(波庫斯|沃[尔爾]克斯)[亞亚][龙龍]草原',
'[鳞|鱗]王(巢穴|之巢)',
'(魔[像象]|哥雷姆|哥雷魯|GOLEM)(?!\\(?(?:魔[像象]|哥雷姆|GOLEM))',
/(【[^【】\n<>\[\]\{\}]+】[^\n【】<>\[\]\{\}]*)[<\[\{]([ ]*[…?-—\w0-9a-zA-Z\u4E00-\u9FFF][^\n【】<>\[\]\{\}]*)[\]\}>]/gm,
'嫉妒吉尔|懒惰吉尔|怠惰吉尔',
'米娅・艾璐罗德',
`神学+(?:院|校|园)`,
/[一-十]/,
/[壹-拾]/,
`[壹-什]`,
`[洞-勾]`,
///[〇-𠃩]/,
///[𠃩]/,
`[四-七]罗`,
/([《(「『【])([^《(「『【』」》)】\n]{1,5})([』」》)】])/g,
].forEach(function (value, index, array)
{
let r = create(value as any, null, {
//disableZh: true,
});
console.log(r);
});
/EARTH|[亞亚]斯\(アース\)/gi
/(波[庫库]斯|沃[尔爾]克斯)[亞亚][龙龍]草原/
/[鳞|鱗]王(巢穴|之巢)/
/(魔[像象]|哥雷姆|哥雷[魯鲁]|GOLEM)(?!\(?(?:魔[像象]|哥雷姆|GOLEM))/
/(【[^【】\n<>\[\]\{\}]+】[^\n【】<>\[\]\{\}]*)[<\[\{]([ ]*[…?-—\w0-9a-zA-Z\u4E00-\u9FFF][^\n【】<>\[\]\{\}]*)[\]\}>]/gm
/嫉妒吉[尔爾]|[懒嬾]惰吉[尔爾]|怠惰吉[尔爾]/
/米[娅婭]・艾璐[罗羅儸]德/
/神[学學]+(?:院|校|[园園])/
/[一二三四五六七八九十]/
/[壹貳參肆伍陸柒捌玖拾]/
/[壹貳參肆伍陸柒捌玖什]/
/[洞幺两三刀五六拐八勾]/
/[四五六七][罗羅儸]/
/([《(「『【])([^《(「『【』」》)】\n]{1,5})([』」》)】])/g
export interface IApi
{
(str: string, flags?: string, skip?: string): zhRegExp
(str: RegExp, flags?: string, skip?: string): zhRegExp
}
console.log(zhRegExp.support);
export declare const support: {
readonly leftContext: boolean;
readonly rightContext: boolean;
readonly lastParen: boolean;
readonly lastMatch: boolean;
readonly input: boolean;
};
FAQs
Generate JavaScript-compatible regular expressions with chinese/jp/zh/cn
The npm package regexp-cjk receives a total of 1,106 weekly downloads. As such, regexp-cjk popularity was classified as popular.
We found that regexp-cjk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.