SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member omega's Avatar
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question A regular expression... :/

    This expression:
    PHP Code:
     /start(.*?)stop/
    would take everything between start and stop. But how goes it when I want take everything between start and stop including start and stop?
    If you can't get rid of the skeleton in your closet, you'd best
    teach it to dance.

  2. #2
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    /(start.*?stop)/
    Of course, that's just my opinion. I could be wrong.

  3. #3
    SitePoint Member omega's Avatar
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, that was exactly what I needed.
    If you can't get rid of the skeleton in your closet, you'd best
    teach it to dance.

  4. #4
    SitePoint Evangelist Mr. Brownstone's Avatar
    Join Date
    May 2002
    Location
    Relative
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. Just to wrap an explanation around it, use parentheses (brackets) to capture matches in your regular-expressions.
    Of course, that's just my opinion. I could be wrong.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •