PDA

View Full Version : Anyone can help on this regular expression?


choon meng
09-05-2000, 03:55 AM
My ASP Forum Site (www.sg-zone.com)<BR><BR>How do i capture the entire string using regular expression such that the output is at like this<BR><BR>My ASP Forum Site <- result is a hyberlink to www.sg-zone.com<BR><BR>Actually my problem is the handling of the space. This is my current re string and it could not handle string<BR><BR>re_url = /(S+)/gi<BR><BR><BR>

Duncan King
09-05-2000, 10:40 AM
Try this one:<BR><BR>re_url = /([ S]+) ((S+))/i<BR><BR>Note that I've removed the "greedy" switch (/g) - I'm assuming that you want to have a file with a bunch of these in and to be able to match each one. Also note the space in the $2 expression - this should catch your spaces.<BR><BR>I'm not sure whether you need the before the ]... Try it and see!<BR><BR>Dunc