RE: Spam:Re: Search and substutiing text and adding in a carriage return?

From: Michael Kraus (mkraus_at_wildtechnology.net)
Date: 11/25/04


Date: Fri, 26 Nov 2004 09:40:53 +1100
To: "FlashMX" <FlashMX@sympatico.ca>, <beginners@perl.org>

G'day...

> s/ MATCH / MATCH NEW /;
>
> Which should output:
>
> MATCH NEW.
>
> The "//" don't work. I'm sure my syntax is wrong.
>
> s/ MATCH / MATCH ///NEW /;
>
> Output I require:
>
> MATCH
> NEW

s/MATCH/MATCH\nNEW/g;

Will replace all instances of MATCH with:

MATCH
NEW

You may also wish to check out the meaning of ^ and $ within RE
context... :)

Regards,
 

Michael S. E. Kraus
Software Developer
Wild Technology Pty Ltd
_______________________________
ABN 98 091 470 692
Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017, Australia
Telephone 1300-13-9453 | Facsimile 1300-88-9453
http://www.wildtechnology.net
 
The information contained in this email message and any attachments may
be confidential information and may also be the subject of client legal
- legal professional privilege. If you are not the intended recipient,
any use, interference with, disclosure or copying of this material is
unauthorised and prohibited. This email and any attachments are also
subject to copyright. No part of them may be reproduced, adapted or
transmitted without the written permission of the copyright owner. If
you have received this email in error, please immediately advise the
sender by return email and delete the message from your system.



Relevant Pages

  • RE: Spam:RE: Return values from methods on Classes/Objects
    ... The information contained in this email message and any attachments may ... legal professional privilege. ... transmitted without the written permission of the copyright owner. ...
    (perl.beginners)
  • RE: Spam:Re: Reading the first line of a file
    ... The information contained in this email message and any attachments may ... legal professional privilege. ... transmitted without the written permission of the copyright owner. ...
    (perl.beginners)
  • RE: Spam:Re: Error: Scalar found where operator expected
    ... The information contained in this email message and any attachments may ... legal professional privilege. ... transmitted without the written permission of the copyright owner. ...
    (perl.beginners)
  • RE: Spam:Re: File Upload Using CGI
    ... The information contained in this email message and any attachments may ... legal professional privilege. ... transmitted without the written permission of the copyright owner. ...
    (perl.beginners)
  • Autmatic function creation
    ... The information contained in this email message and any attachments may ... legal professional privilege. ... transmitted without the written permission of the copyright owner. ...
    (perl.beginners)