Hello everyone, I have one account number. I want to replace all this account numbers and convert them as URLS.
but I don't want to convert existing urls which has account numbers. e.g. 1234-4578 first i convert any existing url into <a> and then I check that if any above number exist then I convert them to my site's url . i am already having regex to check and replace this number. And I can replace all occurrences of this number and convert them into url using re.sub() but problem is that if the value is http://sadfsdf.com/1234-4578 then it first converts http://sadfsdf.com/1234-4578 into <a href=" http://sadfsdf.com/1234-4578">http://sadfsdf.com/1234-4578</a> and then again it converts last number into url so the complete url gets broken. can anybody help me how can I omit the searching existing urls with above number? I have already tried many examples but none of them seems working. Although I can use re.sub('[^/](myregex)','<desirect replacement>',value) but it won't be a permenant solution as if somebody enters /1234-4578 then also it won't convert it. Thanks, Kumar
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor