Last active
December 21, 2015 05:08
-
-
Save iyank4/6254565 to your computer and use it in GitHub Desktop.
Search Replace Regex untuk merapikan kode PHP yang berantakan di Sublime Text
This file contains 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
Lakukan beberapa kali, hingga semuanya di replace. | |
Search | Replace | |
---------------------------------- | |
([a-z_]+);(\n[ ]*)echo => $1. | di search paling belakang kasih 1 spasi setelah echo | |
>(\n[ ]*)"; => >"; | |
";(\n[ ]*)echo \$ => ".\$ | |
";(\n[ ]*)echo " => (kosong) | kosong == '' (ngga pake petik) | |
echo "(\n[ ]*) => echo " | |
\}(\n[ ]*[a-zA-Z\$]) => \}\n$1 | tambah baris kosong setelah blok {...} | |
\n([ ]*)"; => "; | |
penjelasan? ya gitu deh... | |
susah dijelaskan dengan kata-kata :p | |
ngga pake regex: | |
else if => elseif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment