match pattern

Discussion in 'Python' started by rudikk00, Sep 20, 2010.

  1. rudikk00

    rudikk00 Guest

    Hi all,

    I remember perl has a match function =~/H/ --> which searches if there
    is "H" pattern in line. Is there a reasonable analog of it in python?

    thanks!

    Alex
     
    rudikk00, Sep 20, 2010
    #1
    1. Advertising

  2. rudikk00 <> writes:


    > I remember perl has a match function =~/H/ --> which searches if there
    > is "H" pattern in line. Is there a reasonable analog of it in python?


    It's called a regular expression, which can be matched or searched in a
    string. Take a look at the module "re" in python.

    http://docs.python.org/library/re.html

    Diez
     
    Diez B. Roggisch, Sep 20, 2010
    #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. hiwa
    Replies:
    0
    Views:
    642
  2. Victor
    Replies:
    2
    Views:
    651
    Victor
    May 17, 2004
  3. ekzept
    Replies:
    0
    Views:
    378
    ekzept
    Aug 10, 2007
  4. John Gordon
    Replies:
    13
    Views:
    493
    Ian Kelly
    Dec 20, 2011
  5. Volkan Civelek

    Match doesn't match

    Volkan Civelek, Jul 19, 2006, in forum: Ruby
    Replies:
    4
    Views:
    168
Loading...

Share This Page