Skip to content

Instantly share code, notes, and snippets.

@kognise
Created October 2, 2018 13:38
Show Gist options
  • Save kognise/335b46f0e4f6cf326ce22e467476440e to your computer and use it in GitHub Desktop.
Save kognise/335b46f0e4f6cf326ce22e467476440e to your computer and use it in GitHub Desktop.
var checker = /(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.(.aaa|.abarth|.abb|.abc|.abogado|.abudhabi|.ac|.ac.id|.ac.in|.ac.uk|.academy|.accountant|.accountants|.active|.actor|.ad|.ads|.adult|.ae|.aeg|.aero|.af|.afl|.africa|.ag|.agency|.ai|.aig|.airforce|.airtel|.al|.alsace|.am|.americanexpress|.amsterdam|.an|.analytics|.ao|.apartments|.app|.aq|.ar|.arab|.archi|.army|.arpa|.arte|.as|.asia|.associates|.at|.attorney|.au|.auction|.audible|.audio|.author|.auto|.autos|.aw|.aws|.ax|.az|.ba|.baby|.bananarepublic|.band|.bank|.bar|.barcelona|.barefoot|.bargains|.baseball|.basketball|.bayern|.bb|.bbc|.bcn|.bd|.be|.beauty|.beer|.bentley|.berlin|.best|.bestbuy|.bet|.bf|.bg|.bh|.bi|.bible|.bid|.bike|.bingo|.bio|.biz|.bj|.bl|.black|.blackfriday|.blockbuster|.blog|.blue|.bm|.bn|.bo|.bom|.boo|.book|.boots|.boston|.boutique|.box|.bq|.br|.broadway|.broker|.brussels|.bs|.bt|.budapest|.build|.builders|.business|.buy|.buzz|.bv|.bw|.by|.bz|.bzh|.ca|.cab|.cafe|.call|.cam|.camera|.camp|.cancerresearch|.capetown|.capital|.car|.cards|.care|.career|.careers|.cars|.casa|.case|.cash|.casino|.cat|.catering|.catholic|.cc|.cd|.center|.ceo|.cern|.cf|.cfd|.cg|.ch|.channel|.chat|.cheap|.christmas|.church|.ci|.cipriani|.circle|.city|.ck|.cl|.claims|.cleaning|.click|.clinic|.clinique|.clothing|.cloud|.club|.cm|.cn|.co|.coach|.codes|.coffee|.college|.cologne|.com|.community|.company|.compare|.computer|.condos|.construction|.consulting|.contact|.contractors|.cooking|.cool|.coop|.corsica|.country|.coupon|.coupons|.courses|.cr|.credit|.creditcard|.cricket|.cruise|.cruises|.cu|.cv|.cw|.cx|.cy|.cymru|.cz|.dad|.dance|.data|.date|.dating|.day|.de|.deal|.deals|.degree|.delivery|.democrat|.dental|.dentist|.desi|.design|.dev|.diamonds|.diet|.digital|.direct|.directory|.discount|.diy|.dj|.dk|.dm|.do|.docs|.doctor|.dog|.doha|.domains|.dot|.download|.drive|.dubai|.duck|.durban|.dz|.earth|.eat|.ec|.eco|.edu|.education|.ee|.eg|.eh|.email|.energy|.engineer|.engineering|.enterprises|.epost|.equipment|.er|.es|.esq|.estate|.et|.eu|.eus|.events|.example|.exchange|.expert|.exposed|.express|.fail|.faith|.family|.fan|.fans|.farm|.fashion|.fast|.feedback|.fi|.film|.final|.finance|.financial|.fire|.fish|.fishing|.fit|.fitness|.fj|.fk|.flights|.florist|.flowers|.fly|.fm|.fo|.foo|.food|.foodnetwork|.football|.forsale|.forum|.foundation|.fr|.free|.frl|.frontdoor|.fun|.fund|.furniture|.futbol|.fyi|.ga|.gal|.gallery|.game|.games|.garden|.gb|.gd|.gdn|.ge|.gent|.gf|.gg|.gh|.gi|.gift|.gifts|.gives|.gl|.glass|.global|.gm|.gmbh|.gn|.gold|.golf|.gop|.gov|.gp|.gq|.gr|.graphics|.gratis|.green|.gripe|.grocery|.group|.gs|.gt|.gu|.guide|.guitars|.guru|.gw|.gy|.hair|.hamburg|.hangout|.haus|.health|.healthcare|.help|.helsinki|.here|.hiphop|.hiv|.hk|.hm|.hn|.hockey|.holdings|.holiday|.homegoods|.homes|.homesense|.horse|.hospital|.host|.hosting|.hot|.hoteles|.hotels|.house|.how|.hr|.ht|.hu|.ice|.id|.ie|.il|.im|.immo|.immobilien|.in|.industries|.info|.ing|.ink|.institute|.insurance|.insure|.int|.international|.invalid|.investments|.io|.iq|.ir|.irish|.is|.ist|.istanbul|.it|.je|.jetzt|.jewelry|.jm|.jo|.jobs|.joburg|.joy|.jp|.juegos|.kaufen|.ke|.kg|.kh|.ki|.kim|.kinder|.kitchen|.kiwi|.km|.kn|.koeln|.kp|.kr|.krd|.kw|.ky|.kyoto|.kz|.la|.land|.lat|.latino|.law|.lawyer|.lb|.lc|.lease|.legal|.lgbt|.li|.life|.lifeinsurance|.lighting|.like|.limited|.limo|.link|.live|.living|.lk|.loan|.loans|.local|.localhost|.locker|.lol|.london|.lotto|.love|.lr|.ls|.lt|.ltda|.lu|.luxe|.luxury|.lv|.ly|.ma|.madrid|.maison|.makeup|.management|.map|.market|.marketing|.markets|.mba|.mc|.md|.me|.med|.media|.meet|.melbourne|.meme|.memorial|.menu|.mf|.mg|.mh|.miami|.mil|.mint|.mk|.ml|.mm|.mn|.mo|.mobi|.mobile|.mobily|.moda|.moe|.moi|.mom|.money|.mortgage|.moscow|.motorcycles|.mov|.movie|.mp|.mq|.mr|.ms|.mt|.mu|.museum|.mv|.mw|.mx|.my|.mz|.na|.nagoya|.name|.navy|.nc|.ne|.net|.network|.new|.news|.nf|.ng|.ngo|.ni|.nl|.no|.now|.np|.nr|.nrw|.nu|.nyc|.nz|.observer|.off|.okinawa|.om|.one|.one (top-level domain)|.ong|.onion|.onl|.online|.ooo|.open|.org|.organic|.origins|.osaka|.pa|.page|.paris|.partners|.parts|.party|.passagens|.pay|.pe|.pet|.pf|.pg|.ph|.pharmacy|.phone|.photo|.photography|.photos|.physio|.pics|.pictures|.pid|.pin|.pink|.pizza|.pk|.pl|.place|.plumbing|.plus|.pm|.pn|.poker|.porn|.post|.pr|.press|.prime|.pro|.productions|.prof|.promo|.properties|.property|.protection|.ps|.pt|.pw|.py|.qa|.qpon|.quebec|.racing|.radio|.re|.read|.realestate|.realtor|.realty|.recipes|.rehab|.reise|.reisen|.reit|.ren|.rent|.rentals|.repair|.report|.republican|.rest|.restaurant|.review|.reviews|.rich|.rio|.rip|.ro|.rocks|.rodeo|.room|.rs|.rsvp|.ru|.rugby|.ruhr|.run|.rw|.ryukyu|.sa|.saarland|.safe|.sale|.sarl|.save|.sb|.sc|.scholarships|.school|.schule|.science|.scot|.sd|.se|.search|.secure|.security|.select|.services|.sex|.sexy|.sg|.sh|.shiksha|.shoes|.shop|.shopping|.shouji|.show|.showtime|.si|.silk|.singles|.site|.sj|.sk|.ski|.skin|.sky|.sl|.sling|.sm|.smile|.sn|.so|.soccer|.social|.software|.solar|.solutions|.song|.soy|.space|.spot|.spreadbetting|.sr|.ss|.st|.stockholm|.storage|.store|.stream|.studio|.study|.style|.su|.sucks|.supplies|.supply|.support|.surf|.surgery|.sv|.swiss|.sx|.sy|.sydney|.systems|.sz|.taipei|.talk|.tatar|.tattoo|.tax|.taxi|.tc|.td|.team|.tech|.technology|.tel|.tennis|.test|.tf|.tg|.th|.theater|.theatre|.tickets|.tienda|.tips|.tires|.tirol|.tj|.tk|.tl|.tm|.tn|.to|.today|.tokyo|.tools|.top|.tours|.town|.toys|.tp|.tr|.trade|.trading|.training|.travel|.travelersinsurance|.trust|.tt|.tube|.tunes|.tushu|.tv|.tw|.tz|.ua|.uconnect|.ug|.uk|.um|.university|.uno|.us|.uy|.uz|.va|.vacations|.vc|.ve|.vegas|.ventures|.versicherung|.vet|.vg|.vi|.viajes|.video|.villas|.vip|.vision|.vn|.vodka|.vote|.voting|.voto|.voyage|.vu|.vuelos|.wales|.wang|.wanggou|.watch|.watches|.weather|.webcam|.website|.wed|.wedding|.weibo|.wf|.whoswho|.wien|.wiki|.win|.wine|.winners|.work|.works|.world|.wow|.ws|.wtf|.xihuan|.xxx|.xyz|.yachts|.ye|.yoga|.yokohama|.you|.yt|.za|.zero|.zm|.zone|.zuerich|.zw)(:[0-9]{1,5})?(\/.*)?/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment