Hello,
under Windows with ActiveState Perl i have a strange problem with a regex:
Assuming the following String:

my $Data = "Hello, i am a litte String.$ Please format me.$$$ I am the end
of the String.$$ And i am the last!"

The regex should replace $ with the string <br>, $$ with <p> and $$$ with
<br><br> (please don't think about the why)

If tried to use the following:
$data =~ s/\$\$\$/<br><br>/gm; #should catch every occurrence of $$$
$data =~ s/\$\$/<p>/gm; #should catch $$
$data =~ s/\$/<br>/gm; #the rest

So data should look after the first regex:
Hello, i am a litte String.$Please format me.<br><br>I am the end of the
String.$$And i am the last!
And after the second:
Hello, i am a litte String.$Please format me.<br><br>I am the end of the
String.<p>And i am the last!
And the last:
Hello, i am a litte String.<br>Please format me.<br><br>I am the end of the
String.<p>And i am the last!

But all regexes i tried (the one above are only one try) failed! When i
print out the string it looks like:

Hello, i am a litte String. Please format me. I am the end of the
String.3398 And i am the last!

Where the number after String. differs between every run.

Can someone help me ?

With regars
Holger

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to