Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello.
I have the following:
if ($filename =~ m/^{5,}[A-Z]./) { $section_title = ($filename =~ s/[:]?/:</B>\n<BR><BR>/); $filename = ""; }
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.
I've also tried this:
if ($filename =~ m/^{5,}[A-Z]./) { $section_title = ($filename =~ s/?[:]./':</B>\n< BR>< B>\n'); $filename = ""; }
That doesn't work either.
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.
Anyone have any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) RE: Regular Expression Help
by Ovid (Cardinal) on Aug 11, 2000 at 20:53 UTC | |
by KM (Priest) on Aug 11, 2000 at 21:02 UTC | |
|
Re: Regular Expression Help
by coreolyn (Parson) on Aug 11, 2000 at 21:18 UTC | |
|
RE: Regular Expression Help
by jlistf (Monk) on Aug 11, 2000 at 20:40 UTC | |
by nardo (Friar) on Aug 11, 2000 at 20:54 UTC |