Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2615387.eNcf81pqbo@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 11 Apr 2013 21:09:36 +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> MIME-Version: 1.0 Lines: 39 NNTP-Posting-Date: 11 Apr 2013 21:09:39 CEST NNTP-Posting-Host: df745cb4.newsspool3.arcor-online.net X-Trace: DXC=[S6\GJ4N7Bl<6cDJZfMd_cMcF=Q^Z^V3h4Fo<]lROoRa8kF On 2013-04-11 20:40, Thomas 'PointedEars' Lahn wrote: >> GarryJones wrote: >>> How can I change the script to block all email addresses from >>> @forbidden.* >> >> … >> && !/@forbidden\.[^.]+$/.test(…) > ... >>> (Where * can be org, com. co.uk, se ...... etc) > > That pattern won't match "@forbidden.co.uk". Correct. Use … && !/@forbidden(\.[^.]+)+$/.test(…) or … && !/@forbidden(\..+?)+$/.test(…) then (the former is backwards-compatible and presumably more efficient than the latter). You may also want to insert “\s*” before “$” to account for trailing whitespace. The RegExp constructor comes in handy here with regard to an easily maintained list of allowed characters (which reminds me to look into pattern interpolation for jsx.regexp.RegExp). In any case, the expression appropriate for this task can be derived from RFC 5322, section 3.4.1. (I have pos[i]ted the approach before, but I do not know the Message-ID.) -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.