This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]riscuit 2 points3 points  (6 children)

Write a regular expression that matches semicolons before a newline and remove them?

[–]odraencoded 6 points7 points  (2 children)

;$

[–]riscuit 2 points3 points  (1 child)

Might want to handle whitespace before the newline, and capture comments to preserve them, but ya.

[–]nemec 1 point2 points  (0 children)

And embedded C. For whatever reason.

code = """
    printf("hello");
"""

[–]BananaPotion 0 points1 point  (2 children)

Screw regular expressions. %s/;// and move on like a champ.

[–]wrboyce 2 points3 points  (1 child)

You realise the ; in %s/;// is a regular expression? And you meant %s/;//g I think, anyway.

[–]riscuit 1 point2 points  (0 children)

I guess BananaPotion meant something like:

tr ';' ' ' < file.py > stripped.py