Hi Lloyd,
A brief struggle with Perl later....
*************************************Begin
Code*************************************
#!/usr/bin/perl -w
use strict;
my $data;
my $replaced;
my $file;
open(OUT, ">C:\Perl\Test\Output.txt");
$file = "C:\Perl\Test\Input.txt";
{
local $/;
open SLURP, $file or die "Could not open $file:
$!";
$data = <SLURP>;
$data =~
s#(<IMG[^ 42]+)(src=)3D( 42)([^ 42]+)( 42)S+#$1$2$3/
home/
xyz.jpeg$5#m;
close SLURP or die "cannot close $file: $!";
print OUT "$data";
close OUT;
}
*************************************End
Code*************************************
This worked for me. Do let me know how it goes!
Thanks
Sydney
On Jul 24, 8:58 am, "Lloyd K.L" <lloy... gmail.com> wrote:
> Hi Syd,
> Thanks for your intension to help me. Yes, it wraps
in multiple lines. I
> am trying to process an email and trying to replace the
"cid" tag with
> an(file sysem) path.
>
> Regards,
> Lloyd
>
> On 7/23/07, sydc... gmail.com <sydc... gmail.com> wrote:
>
>
>
>
>
> > Hi Lloyd,
>
> > Does this wrap over several lines (as in your
example), or is it one
> > line always?
>
> > Thanks!
> > Syd
>
> > On Jul 20, 2:14 pm, Lloyd <lloy... gmail.com> wrote:
> > > Hi,
> > > I am new to the list and Regex. I am using
posix compliant regex. I
> > > would like to find <img ....> tags in
html and to replace it
>
> > > Let me give an example
>
> > > The input text
>
> > > <IMG align=3Dbottom =
> > > border=3D0=20
> > > height=3D45
src=3D"cid:FBF0FAB9BC9E4E319BBD648467E160C9 RCCF024"=20
>
> > > width=3D59>
>
> > > I want to replace the "
> > >
src=3D"cid:FBF0FAB9BC9E4E319BBD648467E160C9 RCCF024"=20 "
>
> > > with
>
> > > src="/home/xyz.jpeg"
>
> > > How can I do this?
>
> > > can somebody tell me how to find out the
"src" inside an img tag?
>
> > > Thank you very much,
> > > Lloyd- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|