Re: Regex: Limiting Scope without capturing results

Discussion in 'Python' started by Skip Montanaro, Jul 24, 2003.

  1. Gordon> If I remove the ()s around the string|float|color match it stops
    Gordon> matching anything, so is there an alternative to these ? Or a
    Gordon> way of telling them to limit the scope of the match without
    Gordon> capturing the result ?

    Sure, use (?:<pattern>). Full details at 11:

    http://www.python.org/doc/current/lib/re-syntax.html

    Skip
    Skip Montanaro, Jul 24, 2003
    #1
    1. Advertising

  2. Skip Montanaro <> wrote in message news:<>...
    > Sure, use (?:<pattern>). Full details at 11:


    Thanks guys, exactly what I was after.

    G.
    Gordon Chapman, Jul 25, 2003
    #2
    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. Andrew
    Replies:
    11
    Views:
    2,569
  2. JustinCarmony
    Replies:
    1
    Views:
    428
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 2, 2007
  3. Replies:
    3
    Views:
    728
    Reedick, Andrew
    Jul 1, 2008
  4. Bonnie
    Replies:
    0
    Views:
    125
    Bonnie
    Apr 2, 2007
  5. Thomas Hafner

    limiting the scope of a variable

    Thomas Hafner, May 1, 2008, in forum: Ruby
    Replies:
    8
    Views:
    127
    Thomas Hafner
    May 1, 2008
Loading...

Share This Page