View Single Post
Old 03-08-2004, 01:00 PM  
garett
Confirmed User
 
Join Date: Mar 2004
Posts: 683
Quote:
Originally posted by Lane


your code assumes there is at most 1 image url per line, and the regular expression has redundant code.
correct me if i'm wrong.
Thanks for pointing that out.. it's true I didn't think of that.

And looking carefully you should shorten the pattern from this:

/href=[\"|']([^\"|']+.jpg)|([^\"|']+.jpeg)/

To

/href=[\"|']([^\"|']+[.jpg|.jpeg])/

Is that what you had in mind when you said redundant code?
__________________
garett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote