Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?<oldDomain>https?:\/\/(?:registry.yarnpkg.com|registry.npmjs.org|[^\/]+))\/(?<pkgFullName>(?:(?<scopeName>@[\w-]+)(?:\/|%2f))?(?<pkgName>[\w-]+))\/(?:-|download)\/[^#]+-(?<version>[\w\.]+?)\.(?<fileExt>\w+)#(?<hash>\w*)
/
g

Description

替换为淘宝npm

https://r.npm.taobao.org/$2/-/$2-$5.$6#$7
Submitted by anonymous - 5 years ago