You are here

Problems with replacing back slash with forward slash

4 posts / 0 new
Last post
khanhkronos
Offline
Joined: 6 years
Last seen: 3 years
Problems with replacing back slash with forward slash

Hi, I apologize for asking a stupid question, but say for example if I have this temp value to store the URL:

index_temp_1.modify{set|"http://something.com/v\attachfiles_3422\3sthumdai\44dsdsd.jpg"}

and I want to change the backslash to forward slash, how can I do it? I've tried 

index_temp_1.modify{replace|\|/}

but the debugger refuses to acknowledge there are 2 expressions. I guess it got confused between \ and | ?

I also tried {replace|\\|/} but again, didn't seem to do the trick. 

khanhkronos
Offline
Joined: 6 years
Last seen: 3 years

Alright, after a few more trials and errors, I think I found the answer. Just modify the command like this:

index_temp_1.modify{replace(type=regex)|\\|/}

and all back slashes will be forward slashes. Is this the only way to do this though, I wonder?

khanhkronos
Offline
Joined: 6 years
Last seen: 3 years

Thank you for the detailed explanation! I have a feeling the problem is just what you've described. I was thinking along the line of Webgrab misunderstanding the symbols too, but was never able to find a way to correct it until I mess around with regex. Anyway, that is solved now. I have another question, but not sure if I should open another topic for it. For the website I am scraping, there is only one central show page listing all the programs, not the usual multitudes of href links  embbeded in the schedule directing to each page's own show. The problem is not all shows on the schedule is represented on that one show page, and so I was only able to match the index_title with the show titles that are already there. This leads to the classic (?) title issue in the xml file for those shows that are not presented. Is there anyway to force disable the index title and show title check within Webgrab?

khanhkronos
Offline
Joined: 6 years
Last seen: 3 years

Ah, yes...stupid me. That fixed the problem! Thanks again!

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl