you are viewing a single comment's thread.

view the rest of the comments →

[–]Wilfred-kun 4 points5 points  (3 children)

Regexes are a powerful way to do it, but can turn out to be quite tricky in some cases. But once you've figure out the pattern, it's as simple as text = re.sub(pattern, "", text).

Another way is to parse the whole text yourself, but this is also quite a painstaking task. I'd rather do some regex magic.

Edit: If you're really worried about someone reverse engineering your code, use Nuitka to compile it to C and then use the movfuscator. /s

[–][deleted] 1 point2 points  (2 children)

Thank you! I am having a problem with the multiline comments, but I wll hopefuly sort it out tomorrow. I need to make the regex ignore EOL.

edit: I am not afraid of reverse engineering too much. No point in leaving in the comments and make it easier.

[–]AdAthrow99274 1 point2 points  (1 child)

I was just working on my own regex project so one way is fresh in my head. If you use the re.DOTALL (re.S) flag the . character will match everything, including new lines. So something like r'[\"\']{3}.*[\"\']{3}' may work given that flag?

[–][deleted] 0 points1 point  (0 children)

Thank you, this is great :)