Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14751

Re: reg expression

Newsgroups comp.lang.javascript
Subject Re: reg expression
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <jsfv2r$sks$1@speranza.aioe.org> <q1gnu759m1k9lbf8jdqqcam93edn4csn82@4ax.com> <XnsA080557FD310Deejj99@194.109.133.133> <9fudnXyX9bFYrnHSnZ2dnUVZ_qGdnZ2d@inch.com>
Message-ID <XnsA080AF8ECFF79eejj99@194.109.133.133> (permalink)
Date 2012-06-28 15:15 +0000

Show all headers | View raw


Spamless wrote on 28 jun 2012 in comp.lang.javascript:

> On 2012-06-28, Evertjan. <exxjxw.hannivoort@inter.nl.net> wrote:
>> Gene Wirchenko wrote on 28 jun 2012 in comp.lang.javascript:
>>
>>> On Wed, 27 Jun 2012 17:48:15 -0400, "phil hunt" <a@abc.com> wrote:
>>> 
>>>>In Jsctipt, I have
>>>>
>>>>re = new RegExp("one|two", "gi");
>>>>
>>>>"one three".search(re);  return an integer >-1, meaning it found a
>>>>match 
>>>>
>>>>My question is how do I set up the RegExp to match "one" AND "two". I
>>>>though an & would do it, but no.
>>> 
>>>      If you mean that the string contains both "one" and "two", the
> 
> Wouldn't it be nice if you knew the order of the words?
> Sometimes I ... split the text on word boundaries to get an array,
> sort that (now the words are in order) join those up with a space
> separator (now you have a new string with the same words in order)
> and now you just search for "one.*two" (or with word boundaries
> if you don't want subsequences of longer words).

Wouldn't it be nice if you quoted me including something I wrote?

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

reg expression "phil hunt" <a@abc.com> - 2012-06-27 17:48 -0400
  Re: reg expression Bjoern Hoehrmann <bjoern@hoehrmann.de> - 2012-06-27 23:55 +0200
    Re: reg expression Dr J R Stockton <reply1226@merlyn.demon.co.uk.not.invalid> - 2012-06-28 19:08 +0100
      Re: reg expression Spamless <Spamless@Nil.nil> - 2012-06-29 08:22 -0500
        Re: reg expression "Phil Hunt" <aaa@aaa.com> - 2012-06-29 10:19 -0400
          Re: reg expression Spamless <Spamless@Nil.nil> - 2012-06-29 11:36 -0500
          Re: reg expression Gene Wirchenko <genew@ocis.net> - 2012-06-29 10:05 -0700
  Re: reg expression Gene Wirchenko <genew@ocis.net> - 2012-06-27 19:38 -0700
    Re: reg expression Gene Wirchenko <genew@ocis.net> - 2012-06-27 21:18 -0700
    Re: reg expression "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-28 06:24 +0000
      Re: reg expression Spamless <Spamless@Nil.nil> - 2012-06-28 05:36 -0500
        Re: reg expression "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-28 15:15 +0000
          Re: reg expression "Phil Hunt" <aaa@aaa.com> - 2012-06-28 12:08 -0400

csiph-web