
lapsan
Deleted
Aug 11, 2000, 8:39 AM
Post #1 of 2
(5962 views)
|
Matching and Replacing : in line
|
Can't Post
|
|
<p>Hello. <p>I have the following: <pre> if ($filename =~ m/^{5,}[A-Z]./) { $section_title = ($filename =~ s/[:]?/':</B>\n<BR><BR>'/); $filename = ""; } </pre> <p>And it doesn't work. I want it to replace the colon it finds on lines that have the first five characters written in CAPS and replace it with the colon as well as some HTML. <p>I've also tried this: <pre> if ($filename =~ m/^{5,}[A-Z]./) { $section_title = ($filename =~ s/?[:]./':</B>\n<BR><B>\n'/); $filename = ""; } </pre> <p>That doesn't work either. <p>I'm new to regular expressions have been searching for some helpful information on this problem all over the place. Even went so far as to try to use the Reg. Expression used in the Perl Cookbook for parsing text files by comma seperated data. <p>Anyone have any suggestions? Thanks
|