You are here

Remove illegal character

2 posts / 0 new
Last post
vladik007
Offline
Donator
Joined: 6 years
Last seen: 6 months
Remove illegal character

hello,

I'm trying to remove certain characters from title ( the ones that are illegal in file/folder names in Windows , such as " : " " ' " etc ...)

I've copied tv.sms.cz.m.ini to my siteini.user folder and added a line:

index_title.modify {remove|(":"}

Unfortunately it doesnt work. Resulting guide.xml still has the character I tried to remove. I've tried any combination of simple quotes, double quotes, I've also tried titleoriginal.modify {remove|":"} without any effect.

 

 <programme start="20171116101500 +0100" stop="20171116121500 +0100" channel="Prima">
    <title lang="cs">Rosamunde Pilcher: Padající hvězda</title>
    <title lang="">Sternschnuppen im August</title>
    <sub-title lang="cs">Padající hvězda</sub-title>

Any idea what am i doing wrong or have suggestion how to add all Windows file/folder illegal characters [\\/:*?\"<>|] into a single line ? 

vladik007
Offline
Donator
Joined: 6 years
Last seen: 6 months
Blackbear199 wrote:

index_title.modify {remove(type=regex)|[\\/:\*\?\"<>']}

i wouldnt include the vertical pipe |.

webgrab uses this internally as a separator for multi value elements like actor,director,ect.

so u have to be carefull where you use it.u can include it for something like the "title" as there should never be more than one of those.

if you do include it escape it   \| like this.

 

 

Thanks a lot for the regex. It works as expected.

Any idea why 

index_title.modify {remove|":"}

did not work ? 

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