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


Groups > comp.lang.javascript > #7754

Re: Regular expression question

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="ISO-8859-1"
Message-ID <1674123.KyhKTayAOI@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Fri, 28 Oct 2011 03:50:33 +0200
User-Agent KNode/4.4.11
Content-Transfer-Encoding 7Bit
Subject Re: Regular expression question
Newsgroups comp.lang.javascript
References <a9fa509f-5f3c-4926-abc6-c77a21427d8f@j36g2000prh.googlegroups.com> <mxcnirot.fsf@gmail.com> <2997930.SPkdTlGXAF@PointedEars.de> <d20558c5-26d2-4464-9068-db92e87fec9e@a17g2000yqj.googlegroups.com> <c21d1200-abd0-430b-a97e-77c5bcecab47@i15g2000yqm.googlegroups.com>
Followup-To comp.lang.javascript
MIME-Version 1.0
Lines 25
NNTP-Posting-Date 28 Oct 2011 03:50:34 CEST
NNTP-Posting-Host 8e05d1a0.newsspool3.arcor-online.net
X-Trace DXC=LSn8h?JbX7[AX0F2i><W:SMcF=Q^Z^V3X4Fo<]lROoRQ8kF<OcfhCO[9aNUc68?K]XDZm8W4\YJN\;?f@h5gMfb\oI8bW2DgdL^nZ0ohE=O=EX
X-Complaints-To usenet-abuse@arcor.de
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:7754

Followups directed to: comp.lang.javascript

Show key headers only | View raw


Antony Scriven wrote:

> On Oct 28, 1:30 am, Antony Scriven wrote:
>> On Oct 26, 10:40 pm, Thomas 'PointedEars' Lahn wrote:
>> > I cannot think of anything that is simpler than
>> >   var matches = url.match(/(.*)\/([^\/]+)$/);
>> var matches = url.match(/(.*)\/(.*)/);
> 
> And the reason you didn't spot that

Spot what?  That your way is _not_ better?

> is also the reason why Lasse's solution (using
> String.prototype.lastIndexOf) is preferable IMHO. --Antony

http://foo.example/bar

> P.S. Sorry about the mangled quoting earlier.

Don't be sorry about *that*.


PointedEars
-- 
When all you know is jQuery, every problem looks $olvable.

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


Thread

Regular expression question cerr <ron.eggler@gmail.com> - 2011-10-25 21:43 -0700
  Re: Regular expression question Mike Duffy <never@you.mind.com> - 2011-10-26 12:11 +0000
  Re: Regular expression question Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-26 16:54 +0000
  Re: Regular expression question Lasse Reichstein Nielsen <lrn.unread@gmail.com> - 2011-10-26 19:33 +0200
    Re: Regular expression question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-26 23:40 +0200
      Re: Regular expression question Antony Scriven <adscriven@gmail.com> - 2011-10-27 17:30 -0700
        Re: Regular expression question Antony Scriven <adscriven@gmail.com> - 2011-10-27 17:39 -0700
          Re: Regular expression question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-28 03:50 +0200
            Re: Regular expression question Antony Scriven <adscriven@gmail.com> - 2011-10-28 08:46 -0700
            Re: Regular expression question Lasse Reichstein Nielsen <lrn.unread@gmail.com> - 2011-10-28 18:50 +0200
              Re: Regular expression question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-28 19:50 +0200
                Re: Regular expression question Antony Scriven <adscriven@gmail.com> - 2011-10-28 11:41 -0700
                Re: Regular expression question Antony Scriven <adscriven@gmail.com> - 2011-10-28 12:54 -0700
  Re: Regular expression question Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-27 19:41 +0100
    Re: Regular expression question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-28 04:12 +0200

csiph-web