On 4/10/07, <b class="gmail_sendername">Constantinos Neophytou ♎</b> <<a href="mailto:jaguarcy@gmail.com">jaguarcy@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Excellent... one issue though, it seems that it trims some of the<br>line with it on certain cases. I use smarty templates in some of my<br>work, and some lines have text like:<br><br> {$var|modifier}<br><br>after using the command, $var disappears (everything before the pipe,
<br>not including the left curly brace)</blockquote><div><br>When Simon translated Steve's Perl code into Ruby, he missed out a crucial line:<br><br> # Escape anything in the line that might be mistaken<br> # as a snippet token.
<br> $line =~ s/([\$\\`])/\\\1/g; </div><br></div>In Ruby, I think that would be:<br><br> line.gsub!(/([\$\\`])/){"\\#$1"};<br><br>Robin