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


Groups > comp.lang.java.programmer > #28565

Re: regex tidy

From "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Newsgroups comp.lang.java.programmer
References <375vn9th0bc1faa04eg136be53hbvfjq4v@4ax.com> <bubj58Fn42U1@mid.individual.net> <ka54o950v4djcegnt1vsp6t2ii719u7oj5@4ax.com> <buel96FkcmdU1@mid.individual.net> <3eidnVX27IjQtR_OnZ2dnUVZ8iudnZ2d@giganews.com>
Subject Re: regex tidy
Date 2014-05-26 12:12 +0100
Message-ID <jtedndsifodRvB7OnZ2dnUVZ8iWdnZ2d@bt.com> (permalink)

Show all headers | View raw


Leif Roar Moldskred wrote:

> Now, regex engines don't _have_ to use the ordering of the term as a
> suggestion for the order of evaluation, but as far as I'm aware,
> that's how it's usually done.

If the regexp engine is any good at all (some of them -- unforgivably -- are 
not) then it'll match in O(n) on the length of the input with no dependency at 
all[*] on the complexity of the pattern.  In the process it will convert the 
regexp into a (possibly lazy, possibly optimal) FSA and the "ordering" of the 
input patterns will no longer even be meaningful.

    -- chris

[*] to a first approximation, cache effects can presumably be significant 
sometimes. 

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


Thread

regex tidy Roedy Green <see_website@mindprod.com.invalid> - 2014-05-23 11:39 -0700
  Re: regex tidy leif.roar@invalid.com (Leif Roar Moldskred) - 2014-05-23 14:33 -0500
    Re: regex tidy Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-23 15:05 -0500
  Re: regex tidy Robert Klemme <shortcutter@googlemail.com> - 2014-05-24 14:55 +0200
    Re: regex tidy Roedy Green <see_website@mindprod.com.invalid> - 2014-05-25 09:09 -0700
      Re: regex tidy Robert Klemme <shortcutter@googlemail.com> - 2014-05-25 18:49 +0200
        Re: regex tidy leif.roar@invalid.com (Leif Roar Moldskred) - 2014-05-25 12:28 -0500
          Re: regex tidy Robert Klemme <shortcutter@googlemail.com> - 2014-05-25 19:55 +0200
          Re: regex tidy "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-05-26 12:12 +0100
    Re: regex tidy Roedy Green <see_website@mindprod.com.invalid> - 2014-05-25 09:10 -0700
    Re: regex tidy Roedy Green <see_website@mindprod.com.invalid> - 2014-05-25 09:13 -0700
    Re: regex tidy Roedy Green <see_website@mindprod.com.invalid> - 2014-05-25 09:21 -0700
      Re: regex tidy Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-25 13:31 -0500
        Re: regex tidy "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-05-26 12:31 +0100

csiph-web