Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.fsmpi.rwth-aachen.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <3115834.VOAWd18DUa@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 11 Apr 2013 22:04:56 +0200 User-Agent: KNode/4.8.5 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <7867864.kBbL0iy7tU@PointedEars.de> <2615387.eNcf81pqbo@PointedEars.de> MIME-Version: 1.0 Lines: 42 NNTP-Posting-Date: 11 Apr 2013 22:04:56 CEST NNTP-Posting-Host: 06b92cf7.newsspool3.arcor-online.net X-Trace: DXC=\?7LR5XTQN=gP]QSEBQ^d4McF=Q^Z^V384Fo<]lROoR18kF On 2013-04-11 21:09, Thomas 'PointedEars' Lahn wrote: >> Stefan Weiss wrote: >>> On 2013-04-11 20:40, Thomas 'PointedEars' Lahn wrote: >>>> >>>> && !/@forbidden\.[^.]+$/.test(…) > ... >>> That pattern won't match "@forbidden.co.uk". >> >> Correct. Use >> >> … >> && !/@forbidden(\.[^.]+)+$/.test(…) >> >> or >> >> … >> && !/@forbidden(\..+?)+$/.test(…) > > Okay, but that also matches "@forbidden.planet.example.com". So? > In conjunction with the OP's original regex, looking for the substring > "@forbidden." would do the same thing. No, (!x && !y) is logically equivalent to !(x || y). > I don't see any simple and correct general solution for this with a > single regular expression, unless we want to enumerate all currently > known top level domains and their associated reserved second level > domains. Which, by the way, is going to be quite a task soon, because > about 2000 new TLDs are expected to be assigned this year. Maybe you are just thinking about a different problem. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.