CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Post deleted by Gally

 



Gally
New User

Aug 15, 2002, 9:23 AM

Post #1 of 2 (1902 views)
Post deleted by Gally

 


fashimpaur
User / Moderator

Aug 15, 2002, 10:34 AM

Post #2 of 2 (1900 views)
Re: [Gally] Help with regular expressions (regexes) [In reply to] Can't Post

Gally,

If you want a real good Template module, try using HTML::Template.
You can use it even if the rest of the file is plain text.

As for the regex you need,

try this:


Code
   


@tags
= ();

while (<DATA>){
$line = $_;
chomp $line;
while ($line =~ /<\?([^>]+)(?=\?>)/g){
push @tags, $1;
$line = $';
}
}

print
join("\n", @tags);

__DATA__

Here is a sample <?Filetype?> file. It is used to <?usage?> data in another
file. Please feel free to use <?programname?> often.

Thank you,

<?
salesrepname?>
<?
salesreptitle?>

Hope this does what you expected.

Good Luck,
Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives