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: Regular Expressions:
Help regarding Perl regular expression.

 



sgurumukhi
New User

Apr 28, 2011, 5:58 AM

Post #1 of 2 (3258 views)
Help regarding Perl regular expression. Can't Post

We have a perl script. In this script we want regular expression for the below mentioned code.

Input Text :
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>res\us;res;..\dlls;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ResourceOutputFileName>$(IntDir)$(ProjectName).res</ResourceOutputFileName>
</ResourceCompile>
<ClCompile>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>$(ProjectDir)h;$(ProjectDir)db;$(ProjectDir);..\dlls;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>

Output should be:
the content present in <AdditionalIncludeDirectories> tag (of <ResourceCompile> tag only. Not from <ClCompile> tag).
e.g. res\us;res;..\dlls;%(AdditionalIncludeDirectories)

We need an expression which returns contents of <AdditionalIncludeDirectories> present in <ResourceCompile> tag.

Request you to give some inputs on this.


BillKSmith
Veteran

Apr 28, 2011, 7:39 AM

Post #2 of 2 (3255 views)
Re: [sgurumukhi] Help regarding Perl regular expression. [In reply to] Can't Post

It is seldom a good idea to try to parse HTML with regular expressions. There are just to many special cases. Use a module from CPAN. Perhaps someone else can recommend which one.
Good Luck,
Bill

 
 


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

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