Path: csiph.com!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Bunny Bocarisse Newsgroups: comp.lang.javascript Subject: Re: Filter array of objects for property Date: Thu, 13 Oct 2016 13:28:41 +0100 Organization: A noiseless patient Spider Lines: 21 Message-ID: <87pon477ra.fsf@bsb.me.uk> References: <877f9d87y0.fsf@bsb.me.uk> <1770295.oMNUckLgyt@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="d55b9a4918507de28ffdc8b5228c4096"; logging-data="6053"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+V+OH+CakEc+NIRjU+SIBoIGBl/uz3UAY=" Cancel-Lock: sha1:w84u+emTIDrA9oysAV6PH7MyRPE= sha1:eS8KoEfhuMX3eMgiICLOXZ9J1WY= X-BSB-Auth: 1.1ae3f870a70589a08796.20161013132841BST.87pon477ra.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:31570 It was the best of times, it was the worst of times when someone called Thomas 'PointedEars' Lahn wrote the following on a fine sunny Thursday in October: > Ben Bacarisse wrote: >> You can construct a RegExp from a string: >> >> RegExp(pre + '\\d+$').test(tmp) > > First of all, the original regular expression does _not_ match strings that > *start* with “trigger_”; it matches all those that *contain* “trigger_” > followed by a sequence of decimal digits, because the “^” anchor is > missing. Yes. Have you considered switching to answering questions? You'd be good at it. -- Ben.