UNPKG
magnet-link-regex
Version:
latest (1.0.0)
1.0.0
Regex for magnet link
tiaanduplessis/magnet-link-regex
magnet-link-regex
/
index.js
4 lines
(3 loc)
•
183 B
JavaScript
View Raw
1
2
3
4
module
.
exports
=
(
{exact =
false
} = {}
) =>
{
return
exact ?
/^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+$/i
:
/magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+/gi
}