[TxMt] Ruby (Un)Comment command

William D. Neumann wneumann at cs.unm.edu
Wed Dec 22 19:51:13 UTC 2004


On Wed, 22 Dec 2004, Chris Thomas wrote:

> Replace the line:
>
> comment_expr = 
> /^\s*#{regexp_quoted_comments[0]}(.*)#{regexp_quoted_comments[1]}/
>
> With:
>
> # Quote any regexp characters
> regexp_quoted_comments = comment_strings.map {|string| Regexp.quote(string)}
>
> comment_expr = 
> /^\s*#{regexp_quoted_comments[0]}(.*)#{regexp_quoted_comments[1]}/

Works like a charm.  Thanks.

William D. Neumann


---

"There's just so many extra children, we could just feed the
children to these tigers.  We don't need them, we're not doing 
anything with them.

Tigers are noble and sleek; children are loud and messy."

         -- Neko Case

  Think of XML as Lisp for COBOL programmers.

 	-- Tony-A (some guy on /.)



More information about the textmate mailing list