Regex for multiple crypto addresses

« Older   Newer »
 
  Share  
.
  1.  
    .
    Avatar

    Member

    Group
    Administrator
    Posts
    229

    Status
    Offline
    CODE
    // BITCOIN
     if (guid.match(/^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/)) {
       alert("It's a Bitcoin address");
     }

     // LITECOIN
     if (guid.match(/^(L|M)[a-km-zA-HJ-NP-Z1-9]{26,33}$/)) {
       alert("It's a Litecoin address");
     }

     // DOGECOIN
     if (guid.match(/^(D|9)[a-km-zA-HJ-NP-Z1-9]{26,33}$/)) {
       alert("It's a Dogecoin address");
     }

     // ERC-20 (Ethereum, Tether, Ripple, BUSD, BNB, MATIC, ANKR, BAL, RLY, UMA, FaucetPay)
     if (guid.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
       alert("It's an ERC-20 (Ethereum, Tether, Ripple, BUSD, BNB, MATIC, ANKR, BAL, RLY, UMA, FaucetPay)");
     }

     // TRON (TRC-20)
     if (guid.match(/^T[A-Za-z0-9]{33}$/)) {
       alert("It's a TRC-20 token (TRON)");
     }

     // MONERO
     if (guid.match(/^4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}$/)) {
       alert("It's a Monero address");
     }

     // TRX (Tron)
     if (guid.match(/^T[1-9a-km-zA-HJ-NP-Z]{33}$/)) {
       alert("It's a TRX (Tron) address");
     }

     // DASH
     if (guid.match(/^X[1-9A-HJ-NP-Za-km-z]{33}$/)) {
       alert("It's a DASH address");
     }

     // TON (Free TON)
     if (guid.match(/^0:[0-9a-fA-F]{64}$/)) {
       alert("It's a TON (Free TON) address");
     }

     // BAND
     if (guid.match(/^band[0-9a-zA-Z]{39}$/)) {
       alert('It\'s BAND address');
    }

    // BOND

    // AUCTION / FORTH / SKL / GAL / - ERC-20 TOKEN
    // if (guid.match(/^0x[a-fA-F0-9]{40}$/i)) {
    //   alert("It's AUCTION address");
    // }

    // IOTX
    if (guid.match(/^(io|it)[0-9a-zA-Z]{38}$/)) {
     alert("It's IOTX address");
    }

    // CLV
    if (guid.match(/^cl[0-9a-zA-Z]{38}$/)) {
     alert("It's CLV address");
    }

    // AMP
    if (guid.match(/^A[0-9a-zA-Z]{42,43}$/)) {
     alert("It's AMP address");
    }

    // 00 - Address

    // XCN
    if (guid.match(/^[Cc][0-9a-zA-Z]{32,33}$/)) {
     alert("It's XCN address");
    }

    // XRP
    if (guid.match(/^r[0-9a-zA-Z]{24,34}$/)) {
     alert("It's XRP address");
    }

    // BEP-20
    if (guid.match(/^0x([A-Fa-f0-9]{40})$/)) {
     alert("It's BEP-20 address");
    }

    // ByteCoin (BCN)
    if (guid.match(/\bBCN[0-9a-zA-Z]{94}\b/)) {
     alert("It's ByteCoin (BCN) address");
    }
     
    .
0 replies since 24/4/2024, 23:54   3 views
  Share  
.