Last active
August 29, 2015 14:13
-
-
Save itsbth/a80b52d4990331f69708 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lfn28p3 = (fn) -> | |
| l, ext = fn\match "(.+)%.([^.]+)" | |
| fn = l if l | |
| fn = fn\upper() | |
| fn = fn\gsub "[,[%];=+]", "_" | |
| fn = fn\gsub "[^%a%d_.]", "" | |
| fn = fn\sub(1, 6) .. "~1" if fn\len() > 8 | |
| ext = ext\sub(1, 3) if ext\len() > 3 | |
| return fn .. "." .. ext | |
| print lfn28p3("Kirill Pokrovsky-Original Sin.mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment