Closed Olivier6767 closed 3 years ago
Hi there, this sounds like a reasonable feature request. A decision was made to not introduce support for regular expressions when the transform arguments were introduced.. but I honestly can't remember what the reason was now because it was so long ago.
I'll take a look to see what can be done.
Great! Thank you.
I've added a new https://github.com/jjssoftware/m3u-epg-editor/tree/regex_transforms branch that contains a candidate change for this new feature.
I've given this a quick test using the following config which matches some test data similar as you advised and it appeared to result in the expected outcome:
"channel_transforms": [
{"(UK: VIP )(.*)(HEVC|.HD)": "\\2"}
]
I'd appreciate it if you could give it a try, thanks.
Thank you! I've tested and it does work as expected. I was able to clean-up the channel names for my complete channel list using 11 regex in the channel_transforms. This is awesome!
Can this be easily implemented for group_transforms as well?
Thanks that's good to hear. Please give regex a try with the group_transforms
argument too, the change has been applied in an area that hopefully should work for that too.
I confirm it works well in group_transforms
as well.
This is a great enhancement.
Many Thanks!
Thanks for confirming, I'll merge the change
Hello, First of all Thank you for this tool, very helpful ! Would it be possible to add Regex substitution for channel_transforms?
To explain why this would be useful, here is an example from my provider's channel list:
And here is what I would like to have:
I can use key:value pairs in channel_transforms, but I have over 300 channels to rename.
I was thinking about the possibility to use a regex substitution like this:
/ (UK: VIP )(.*)(HEVC|.HD) / $2
which provides the desired result. Obviously I would need multiple entries to cover other country prefixes for example.Is this something that could be added?
Thanks for considering it!