Starfighter Posted August 2, 2007 Share Posted August 2, 2007 Hi People, I've a problem with the StringRegExpReplace function: I want delete all URL-Links, only between <td class=char>xxx</td> and <td class=nm> tags (xxx=any string). Dim $InputString Dim $OutputString $InputString="<h5>Photo Gallery:</h5><http://i.imdb.com/Photos/Ss/0090605/th-IMG0064.jpg><http://i.imdb.com/Photos/Ss/0090605/th-6053_16_1.jpg><h5>Cast:</h5><td class=nm>Sigourney Weaver</td><td class=char>Ellen Ripley</td><td class=nm>Carrie Henn</td><td class=char>Rebecca 'Newt' Jorden</td><http://ia.imdb.com/media/imdb/01/I/51/65/22t.jpg><td class=nm>Michael Biehn</td><td class=char>Cpl. Dwayne Hicks</td><http://ia.imdb.com/media/imdb/01/I/73/36/29t.jpg><td class=nm>Lance Henriksen</td><td class=char>Bishop</td>" $OutputString=StringRegExpReplace($InputString,"<td class=char>[\^]</td>(.*?)<td class=nm>","<td class=char>[\^]</td><td class=nm>") Msgbox(0,"Test",$OutputString) What's wrong? Best thanks for your help Link to comment Share on other sites More sharing options...
GMK Posted August 2, 2007 Share Posted August 2, 2007 When you replace the text, the replacement string needs to be exact. There's probably a better way to do it, but I think this should give you what you want: $OutputString = StringRegExpReplace($InputString,"</td><http(.*?)<td class=nm>","</td><td class=nm>") Link to comment Share on other sites More sharing options...
Starfighter Posted August 2, 2007 Author Share Posted August 2, 2007 When you replace the text, the replacement string needs to be exact. There's probably a better way to do it, but I think this should give you what you want: $OutputString = StringRegExpReplace($InputString,"</td><http(.*?)<td class=nm>","</td><td class=nm>") Thank you very much! I'm blind Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now