SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes I have to use reg expres. for quite an amount of data, how bad could it affect the speed/runtime of the script?
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  2. #2
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's slow but not horribly slow. I read somewhere that it is faster than substr. It also depends if you use greedy or non-greedy regular expressions. Non-greedy look for the smallest possible result while greedy look for the largest possible result. Greedy are normal and I believe slightly faster. There are entire books on how to optime regular expressions if you really want to maximize speed. (I recomend Master Regular Expressions, O'Reilly.)

    Owen


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
  •