Last active
August 29, 2015 14:01
-
-
Save markingman/236d8b75bac861361772 to your computer and use it in GitHub Desktop.
BBEdit Text Filter: reset PHP links
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
#!/usr/bin/php | |
<?php | |
/** | |
* BBEdit reset PHP links text filter | |
* When editing attributes for <a> tag with PHP link (<a href="<?=FOO?>">), reset '<?=...?>' to '<?=...?>' | |
*/ | |
while($l = fgets(STDIN)) | |
{ | |
$l = preg_replace('~ (action|href)="<\?=(\$*[^\?]+)\?>"~',' \1="<?=\2?>"',$l); | |
echo $l; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment