SPUG: Anyone savvy in this?

Tim Maher tim at consultix-inc.com
Wed Jan 30 11:33:22 CST 2002


On Wed, Jan 30, 2002 at 09:27:19AM -0800, Susanne Bullo wrote:
> I think I have it narrowed down but am still unclear as to what should be
> in:
> 

> $row[4] =~ s/<br />/somethinghere/g;

You need to "quote" the literal / within the regular expression field,
like so:

	$row[4] =~ s/<br \/>/somethinghere/g;

Or better still, use a different delimiter:

	$row[4] =~ s|<br />|somethinghere|g;

Also, are you sure there will always be a single space after the br?
If not, put an asterisk after it, which means any number of spaces,
including 0, is okay:

	$row[4] =~ s|<br */>|somethinghere|g;

> 
> Basically, I want to look at that string in $row[4], find all instances of
> <br /> and replace it with line breaks.

Then I think you want:

	$row[4] =~ s|<br */>|<br>|g;

I won't even ask how you got those messed up line-break tags there
in the first place! 8-}

> 
> Susanne Bullo - Sweet Homes
> 
-- 
*==============================================================================*
|  Dr. Tim Maher, CEO, Consultix          (206) 781-UNIX/8649;  ask for FAX#   |
|  tim at consultix-inc.com   www.consultix-inc.com   www.softwareprofessor.com   |
| FEB: Perl; APR: Shell; Int. & OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl |
*------------------------------------------------------------------------------*
| NEW Seminar Series!  "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18  |
| Adv. OOP  *  Adv. Module Implementation Techniques  *  Programming in Perl 6 |
*==============================================================================*

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list