Gossamer Forum
Home : General : Perl Programming :

Regex again.

Quote Reply
Regex again.
$description = qq~
This is my description. Here goes a couple of headings in it
This is abc:
this is the heading one and needs to bold and underlined
That was xyz:
needs to bold and underlined too.
description continues here

I am producing HTML files from input. I need to underline and make bold these headings when the output is
generated. Any ideas on how to extract these headings (i.e. This is abc: and That was xyz:) and make the changes for output?

The two definate markers for these headings are there is always a line break before and after the heading and it always contains the colon at the end :

Thanks for any input

Last edited by:

zeshan: Jul 22, 2003, 3:42 PM
Quote Reply
Re: [zeshan] Regex again. In reply to
$description =~ s/^(.+?):/<b>$1</b>/mg;


Gossamer Threads Inc.