regex

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael G

    regex

    I want to match mailto:null@voi d.com......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

    #2
    Re: regex


    "Michael G" <mike-g@montana.com> wrote in message
    news:40156410_3 @corp.newsgroup s.com...[color=blue]
    > I want to match mailto:null@voi d.com......gif in a string that contains[/color]
    many[color=blue]
    > 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[/color]
    be[color=blue]
    > 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
    >[/color]

    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! =-----

    Comment

    • Michael G

      #3
      Re: regex

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

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



      "Michael G" <mike-g@montana.com> wrote in message
      news:40156410_3 @corp.newsgroup s.com...[color=blue]
      > I want to match mailto:null@voi d.com......gif in a string that contains[/color]
      many[color=blue]
      > 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[/color]
      be[color=blue]
      > 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! =-----[/color]




      -----= 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! =-----

      Comment

      Working...