WEB which of these is more efficient? .htaccess pattern block

Discussion in 'OT Technology' started by White Stormy, Aug 3, 2008.

  1. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    Code:
    folder/([0-9]+)/?|folder/?
    or
    Code:
    folder(/(([0-9]+)/?)?)?
    or is there a better way to match..
    folder
    folder/
    folder/[0-9]+
    folder/[0-9]+/
     
  2. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    I guess if I could just write a rule not to worry about trailing slashes anywhere, I could make this part a lot shorter..?
     
  3. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
  4. Ender0910

    Ender0910 woot!

    Joined:
    Jun 1, 2004
    Messages:
    3,039
    Likes Received:
    0
    Location:
    Redmond/Bay Area
    not that regular expressions are very readable in the first place, but you could consider just making 4 entries in the .htaccess to make it simpler to look at.
     
  5. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    well I guess I could just do

    folder/?
    folder/[0-9]+/?
     
  6. sneakyjesus

    sneakyjesus New Member

    Joined:
    Dec 10, 2007
    Messages:
    409
    Likes Received:
    0
    Location:
    Atl, Ga
  7. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    :rofl:
     

Share This Page