On Jun 10, James Edward Gray II said:

>s/\\([A-Za-z0-9]+?) \[(\d+?)\]/$1\[$2]/;

There's no reason NOT to capture the brackets.  Also, the non-greediness
you've supplied is useless, since there's no way for them to match too
much.  After the [A-Za-z0-9] is a space, which is NOT matchable by
[A-Za-z0-9], and after the \d there is a ], which can't be matched by \d.

  s/\\([a-zA-Z0-9]+) (\[\d+\])/$1$2/g;

I might even go so far as to say

  s/\\([a-zA-Z0-9]+) (?=\[\d+\])/$1/g;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to