Breaking Out Forum Index Breaking Out
Breaking Out release board.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 




Regex for multiple crypto addresses

 
Post new topic   Reply to topic    Breaking Out Forum Index -> Coding
View previous topic :: View next topic  
Author Message
hacxx



Joined: 04 Sep 2020
Posts: 1162

PostPosted: Wed Apr 24, 2024 10:48 pm    Post subject: Regex for multiple crypto addresses Reply with quote

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");
}

_________________
Install Brave Browser for 30 days arnd earn money. - http://bit.ly/_brave_browser
Back to top
View user's profile Send private message Visit poster's website AIM Address
Free Forum






PostPosted:      Post subject: ForumsLand.com

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Breaking Out Forum Index -> Coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosted by ForumsLand.com - 100% free forum. Powered by phpBB 2.