You are here

remove text after a special char

5 posts / 0 new
Last post
Grabber66
Offline
Joined: 1 month
Last seen: 5 days
remove text after a special char

Hi,

ich had some troubel with an ini-file. I want to remove all text after a special char. In my Case it is } or ".
I don't know if these char's are problematic.

Maybe anybody can help me....thx

Blackbear199
Offline
WG++ Team memberDonator
Joined: 3 years
Last seen: 5 hours

having a } in the epg data is unusual,a " is more common but it sounds like a scrub issue to me.
post a sample of the html/json code and the scrub ur using.

Grabber66
Offline
Joined: 1 month
Last seen: 5 days

Hi,

I've found someone with the same issue.
http://www.webgrabplus.com/content/need-fix-horizontvini-revision-6-2507...

Fact is, that actually the subtitle isn't scrubed enough.
eg. "},"parentId":"crid:~~2F~~2Fbds.tv~~2F179614169 isn't removed.

thx

Blackbear199
Offline
WG++ Team memberDonator
Joined: 3 years
Last seen: 5 hours

as i said,this is a scrub issue.
post some sample data(or is it horizon.tv?)

horizon.tv can be fixed by changing the scrub from..

subtitle.scrub {single|"secondaryTitle":"||",|",}

to
subtitle.scrub {regex||"secondaryTitle":"(.*?)"[,\}]||}

see the diff?

the first one looks for ", as the ee/be(element end/block end) but sometimes its "} so this fails and the xtra info that you see in your example is grabbed.

now this could be simply changed to..

subtitle.scrub {single|"secondaryTitle":"||"|"}

now the ee/be is simply a " which wud match ", or "} but the chance you take here is what if the subtitle had a word like this "xxxx" (inside quotes).it would be cut off at the first ",thats why we use ", usually as it makes it safer.

using regex we can specify either ", or "} as the end string.

Grabber66
Offline
Joined: 1 month
Last seen: 5 days

Thx for your explanation. With this it is easier to understand the faq.

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