regex

Discussion in 'Perl' started by Michael G, Jan 26, 2004.

  1. Michael G

    Michael G Guest

    I want to match mailto:......gif in a string that contains many
    similar patterns.

    I used "mailto:(.[^"]*)" to match each "mailto: ..." string. The parans
    then allowed me to get at the email address.

    But now I realize I need more info from each match.
    I need to extend the match to the first 'gif' (the characters 'gif' would be
    the end of the string instead of ' " ' as in my first regex.) but I am
    having some trouble doing so.

    I have tried a number of different combinations but without the match I
    need.

    I know what I need. I need to do as I did in the example above except I
    need to not include a group of characters instead of just one.

    Thanks, Mike




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    Michael G, Jan 26, 2004
    #1
    1. Advertising

  2. Michael G

    Michael G Guest

    "Michael G" <> wrote in message
    news:...
    > I want to match mailto:......gif in a string that contains

    many
    > similar patterns.
    >
    > I used "mailto:(.[^"]*)" to match each "mailto: ..." string. The parans
    > then allowed me to get at the email address.
    >
    > But now I realize I need more info from each match.
    > I need to extend the match to the first 'gif' (the characters 'gif' would

    be
    > the end of the string instead of ' " ' as in my first regex.) but I am
    > having some trouble doing so.
    >
    > I have tried a number of different combinations but without the match I
    > need.
    >
    > I know what I need. I need to do as I did in the example above except I
    > need to not include a group of characters instead of just one.
    >
    > Thanks, Mike
    >


    this works

    "mailto:(.[^"]*)".*gif"{1}




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    Michael G, Jan 26, 2004
    #2
    1. Advertising

  3. Michael G

    Michael G Guest

    no regex experts?
    I am surprised that no one responded. I did finally figure it out.

    /"mailto:(.[^"]*)".*?gif/i



    "Michael G" <> wrote in message
    news:...
    > I want to match mailto:......gif in a string that contains

    many
    > similar patterns.
    >
    > I used "mailto:(.[^"]*)" to match each "mailto: ..." string. The parans
    > then allowed me to get at the email address.
    >
    > But now I realize I need more info from each match.
    > I need to extend the match to the first 'gif' (the characters 'gif' would

    be
    > the end of the string instead of ' " ' as in my first regex.) but I am
    > having some trouble doing so.
    >
    > I have tried a number of different combinations but without the match I
    > need.
    >
    > I know what I need. I need to do as I did in the example above except I
    > need to not include a group of characters instead of just one.
    >
    > Thanks, Mike
    >
    >
    >
    >
    > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    >
    >
    >
    >
    > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----





    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    Michael G, Jan 29, 2004
    #3
    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. =?Utf-8?B?SmViQnVzaGVsbA==?=

    Is ASP Validator Regex Engine Same As VS2003 Find Regex Engine?

    =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    695
    =?Utf-8?B?SmViQnVzaGVsbA==?=
    Oct 22, 2005
  2. Rick Venter

    perl regex to java regex

    Rick Venter, Oct 29, 2003, in forum: Java
    Replies:
    5
    Views:
    1,619
    Ant...
    Nov 6, 2003
  3. Replies:
    2
    Views:
    594
  4. Xah Lee
    Replies:
    1
    Views:
    937
    Ilias Lazaridis
    Sep 22, 2006
  5. Replies:
    3
    Views:
    745
    Reedick, Andrew
    Jul 1, 2008
Loading...

Share This Page