minimalist regular expression

Discussion in 'Perl Misc' started by borges2003xx@yahoo.it, Aug 25, 2005.

  1. Guest

    Exists some tool, programs or some able to compute the minimal regular
    expression, namely ,taking a series of regular exoression, the minimal
    one that makes the same matching?
    thanx in advance
    , Aug 25, 2005
    #1
    1. Advertising

  2. John Bokma Guest

    John Bokma, Aug 25, 2005
    #2
    1. Advertising

  3. Guest

    the shortest description in regex way
    , Aug 26, 2005
    #3
  4. Paul Lalli Guest

    wrote:
    > Exists some tool, programs or some able to compute the minimal regular
    > expression, namely ,taking a series of regular exoression, the minimal
    > one that makes the same matching?
    > thanx in advance


    m//;

    it matches everything. Perhaps you need to better define your problem
    statement. Sample input, desired output...

    Paul Lalli
    Paul Lalli, Aug 26, 2005
    #4
  5. John Bokma Guest

    John Bokma, Aug 26, 2005
    #5
  6. Paul McGuire Guest

    Google for "optimized regexp" returns:
    http://laurent.riesterer.free.fr/regexp/make-regexp.html
    http://search.cpan.org/~dankogai/Regexp-Optimizer-0.15/

    There are several more links, but all appear to be written in languages
    other than Python. Perhaps you could port one of them.

    It also seems that a similar thread came up here recently, at least in
    the special form of converting a list of words to a single regexp. In
    general, this seems to be a difficult problem, not only to implement,
    but to test. At least the conversion of a list of words to a single
    regexp is easily tested against the input set, although as some of the
    other clever posters have noted, it is possible to create a regexp that
    is *too* matchable.

    -- Paul
    Paul McGuire, Aug 26, 2005
    #6
  7. Paul Lalli wrote:
    >
    > m//;
    >
    > it matches everything.


    Not in Perl it doesn't. :)
    Brian McCauley, Aug 26, 2005
    #7
  8. Paul Lalli Guest

    Brian McCauley wrote:
    > Paul Lalli wrote:
    > >
    > > m//;
    > >
    > > it matches everything.

    >
    > Not in Perl it doesn't. :)


    Sure it does.... provided you haven't tried matching anything else
    beforehand...

    Paul Lalli
    Paul Lalli, Aug 26, 2005
    #8
  9. Guest

    Whenever I ask a match in a string for(a{3,}b and match for (a{1,}, the
    first is implicit second: ab is implicit in a.*;automatically
    , Aug 26, 2005
    #9
  10. Anno Siegel Guest

    [newsgroups trimmed]

    Paul Lalli <> wrote in comp.lang.perl.misc:
    > Brian McCauley wrote:
    > > Paul Lalli wrote:
    > > >
    > > > m//;
    > > >
    > > > it matches everything.

    > >
    > > Not in Perl it doesn't. :)

    >
    > Sure it does.... provided you haven't tried matching anything else
    > beforehand...


    It's okay if he only tried matching something else. It starts not
    matching things if he tried and succeeded.

    Anno
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
    Anno Siegel, Aug 29, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,269
  2. Uncle Bob (Robert C. Martin)

    Use Cases -- A minimalist's View

    Uncle Bob (Robert C. Martin), Jul 2, 2003, in forum: Java
    Replies:
    0
    Views:
    751
    Uncle Bob (Robert C. Martin)
    Jul 2, 2003
  3. Sam

    Minimalist executable

    Sam, Aug 15, 2003, in forum: C Programming
    Replies:
    3
    Views:
    529
    Mark McIntyre
    Aug 16, 2003
  4. Replies:
    10
    Views:
    551
  5. Chris Thomasson

    Very Simple, Minimalist Technique For OOP in C...

    Chris Thomasson, Jun 21, 2007, in forum: C Programming
    Replies:
    10
    Views:
    653
    Johan Bengtsson
    Jun 24, 2007
Loading...

Share This Page