Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save petermaurer/4132667 to your computer and use it in GitHub Desktop.
Save petermaurer/4132667 to your computer and use it in GitHub Desktop.
Hardcore evil characters cleaner for Name Mangler (shortened, fixed "g" equivalents, some other minor changes)
[findRegularExpression "[ÀàÁáÂâÃãÄäÅåĀāĂ㥹ǞǟǺǻ]", <name>, "a"]
[findRegularExpression "[ÆæǼǽ]", <name>, "ae"]
[findRegularExpression "[Ḃḃ]", <name>, "b"]
[findRegularExpression "[ĆćÇçČčĈĉĊċ]", <name>, "c"]
[findRegularExpression "[ḐḑĎďḊḋĐđÐðDZdzDŽdž]", <name>, "d"]
[findRegularExpression "[ÈèÉéĚěÊêËëĒēĔĕĘęĖėƷʒǮǯ]", <name>, "e"]
[findRegularExpression "[Ḟḟƒfffiflffifflſt]", <name>, "f"]
[findRegularExpression "[ǴǵĢģǦǧĜĝĞğĠġǤǥ]", <name>, "g"]
[findRegularExpression "[ĤĥĦħ]", <name>, "h"]
[findRegularExpression "[ÌìÍíÎîĨĩÏïĪīĬĭĮįİıIJij]", <name>, "i"]
[findRegularExpression "[Ĵĵ]", <name>, "j"]
[findRegularExpression "[ḰḱĶķǨǩĸ]", <name>, "k"]
[findRegularExpression "[ĹĺĻļĽľĿŀŁłLJlj]", <name>, "l"]
[findRegularExpression "[Ṁṁ]", <name>, "m"]
[findRegularExpression "[ŃńŅņŇňÑñʼnŊŋNJnj]", <name>, "n"]
[findRegularExpression "[ÒòÓóÔôÕõÖöŌōŎŏØøŐőǾǿŒœ]", <name>, "o"]
[findRegularExpression "[Ṗṗ]", <name>, "p"]
[findRegularExpression "[ŔŕŖŗŘřɼ]", <name>, "r"]
[findRegularExpression "[ŚśŞşŠšŜŝṠṡſ]", <name>, "s"]
[findRegularExpression "[ß]", <name>, "ss"]
[findRegularExpression "[ŢţŤťṪṫŦŧÞþ]", <name>, "t"]
[findRegularExpression "[ÙùÚúÛûŨũÜüŮůŪūŬŭŲųŰű]", <name>, "u"]
[findRegularExpression "[ẀẁẂẃŴŵẄẅ]", <name>, "w"]
[findRegularExpression "[ỲỳÝýŶŷŸÿ]", <name>, "y"]
[findRegularExpression "[ŹźŽžŻż]", <name>, "z"]
[findRegularExpression "[-–—‾_,;:!¡\?¿.…·'‘’‚‹›“”„«»\(\)\[\]\{\}§¶@*/&#%‰†‡•`´^¯¨¸°©®←→↑↓+±÷×<=>¬|¦~●♠♣♥♦¤¢$£¥¹½¼²³¾ªº™αβγδεζηθικλμνξοπρστυφχψω ]+", <name>, "-"]
[lowercase
[concatenate <name>, <.extension>]
]
@petermaurer
Copy link
Author

Kudos to @theamnesic for the work he put into his original cleaner! I just transformed it a little to make it easier to deal with, in my humble opinion.

@petermaurer
Copy link
Author

Added the space character to the last regular expression to match the behavior indtended by @theamnesic more closely. Example: "A ♠ ♣ ♥ ♦ B" => "a-b".

@theamnesic
Copy link

Hey @petermaurer !

4 years after (!), our snippet does not work anymore ...
https://infinit.io/_/YkSGQz7

The problem comes from the # character on the last regex.
I don't understand why ... Any idea ?

Thanks!

— G

@ndcisiv
Copy link

ndcisiv commented Nov 16, 2018

This saved me a lot of time today, so thank you. As to the # character, I simply escaped it with a \ and it worked perfectly in the current version. Renamed as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment