RE: general multipliers in a substitution regexp..

2001-09-07 Thread Dan
--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote: > On Sep 7, [EMAIL PROTECTED] said: > > >$somestring =~ s!>!)!g; > > Then I would suggest tr/>/!/, which is a "better" way to write such > substitutions, for certain values of "better". Ah I am familiar with the tr/// route - I sho

RE: general multipliers in a substitution regexp..

2001-09-07 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 7, Jeff 'japhy/Marillion' Pinyan said: >On Sep 7, [EMAIL PROTECTED] said: > >>$somestring =~ s!>!)!g; > >Then I would suggest tr/>/!/, which is a "better" way to write such >substitutions, for certain values of "better". My bad. I really meant tr/>/)/. -- Jeff "japhy" Pinyan [EMAI

RE: general multipliers in a substitution regexp..

2001-09-07 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 7, [EMAIL PROTECTED] said: >$somestring =~ s!>!)!g; Then I would suggest tr/>/!/, which is a "better" way to write such substitutions, for certain values of "better". -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.per

RE: general multipliers in a substitution regexp..

2001-09-07 Thread pconnolly
why not just do $somestring =~ s!>!)!g; that will replace every ">" with a ")". This way you do not even have to worry about $stringlength. > -Original Message- > From: Dan [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 07, 2001 11:15 AM > To: [EMAIL PROTECTED] > Subject: general

Re: general multipliers in a substitution regexp..

2001-09-07 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 7, Dan said: >If I have a string with say a number of '>>' in it which may be >variable in length and I wish to write a regexp to match and replace it >with the equivalent number of ')'s [ie would become ] There's a very clever solution to this in "Effective Perl Programming"