Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
匹配npm源地址
Open Workspace
JavaScript
Match
Created 2020-02-24 03:47
0
Regular Expression
/
(?<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