
fashimpaur
User
/ Moderator
Aug 15, 2002, 10:34 AM
Post #2 of 2
(1610 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: @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";
|