[tpm] New Regex question

Rob Janes janes.rob at gmail.com
Sat Oct 27 16:37:45 PDT 2012


That's what I thought.

Until I tried it.  The second use case does not work with $1.

Try it.
On Oct 27, 2012 7:22 PM, "Uri Guttman" <uri at stemsystems.com> wrote:

> On 10/27/2012 06:57 PM, Rob Janes wrote:
>
>> $1 doesn't work.
>>
>> \1 is the characters matched while $1 is the pattern matched.
>>
>> It only matters if u want to match pure string.
>>
>
> that is wrong. both are only references to a grab which is always a
> string. you can use \1 in the regex to match what you have previously
> matched and grabbed. $1 is used in the replacement or after the regex to
> get what was grabbed. neither contains a regex.
>
> uri
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20121027/6629e104/attachment.html>


More information about the toronto-pm mailing list