[TxMt] regex question

Charilaos Skiadas cskiadas at uchicago.edu
Tue Feb 21 23:38:35 UTC 2006


On Feb 21, 2006, at 5:23 PM, Oliver Taylor wrote:

> I'm using the following (adapted from Dr. Drang's suggestion):
>
> ^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$
>
> for a search and replace string like this one:
>
> s/^([A-Z]+.*[A-Z]*\s*)\n(\(.+\))\n(.+)$/\n\n\t{4}$1\n\t{3}$2\n\{2}$3/;
>
> ...which makes sense to me, but it doesn't insert those tabs or  
> newlines when piped thru a command. Clearly I'm missing something  
> here. As you can no-doubt tell, I'm a complete noob when it comes  
> to all this programing.

I guess i misunderstood you, I thought you just wanted to change the  
language grammar, not do search and replace stuff. This should work  
all right, though I am not sure what you mean by "piped thru a  
command", I thought you were just doing a search and replace. In that  
case, using \t\t\t\t instead of \t{4} should do the trick. The \t{4}  
only has a meaning in the regexp to be matched, not in the expression  
to replace it.
.
> As an example, this:
> -----------------
> OLIVER
> (I want to tell you)
> I've got things to say.
> Dr. Robert
> -----------------
> should look like this:
> ---------------------------
>
> 				OLIVER
> 			(I want to tell you)
> 		I've got things to say.
>
> Dr. Robert
> ---------------------------

What do you get when you use the above? How are you using the above?  
Are you simply doing find&replace with regexp on?

Haris





More information about the textmate mailing list