Notorious Puppy Memes

    magnet-link-regex

    1.0.0 • Public • Published

    magnet-link-regex

    package version package downloads standard-readme compliant package license make a pull request

    Regex for magnet link

    Table of Contents

    Install

    This project uses node and npm.

    $ npm install magnet-link-regex
    # OR 
    $ yarn add magnet-link-regex

    Usage

    const magnetLinkRegex = require('magnet-link-regex')
     
    const urls = [
      `magnet:?xt=urn:btih:211361b71d2e589ca44b99e0b9ce7d838d58e48a&dn=The.Big.Bang.Theory.S11E22.HDTV.x264-SVA&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969`,
      `magnet:?xt=urn:btih:42f7d12bdf685907ddc7eae532d3e4214e8f12d5&dn=Fear.the.Walking.Dead.S04E07.HDTV.x264-SVA%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969`,
      `magnet:?xt=urn:btih:37a8e3b4564996c13b408ebb695431dbf9f0e1c8&dn=Billions.S03E11.WEB.H264-DEFLATE%5Bettv%5D&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969`
    ]
    const pattern = magnetLinkRegex({exact: true})
     
    urls.forEach(url => {
      console.log(pattern.test(url))
    })
     

    Contribute

    1. Fork it and create your feature branch: git checkout -b my-new-feature
    2. Commit your changes: git commit -am 'Add some feature'
    3. Push to the branch: git push origin my-new-feature
    4. Submit a pull request

    License

    MIT

    Install

    npm i magnet-link-regex

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.32 kB

    Total Files

    5

    Last publish

    Collaborators

    • tiaanduplessis