Link to home
Start Free TrialLog in
Avatar of saibsk
saibsk

asked on

Perl regular expression issue

file 1 contains:

<td><font ><strong>Type :</strong></font>
                              
                                    <A href="index.cfm?fuseaction=display&Instance=2&ssrid=x37103cc4cf651faff651427678f197d7"><font>Extension1</font></a>

                              
                           </td>

File 2 contains:

<td><font><b>Type:</b></font>
                  
                        
                        <A href="index.cfm?fuseaction=display&Instance=2&ssrid=xb3ac14a5bfa034397ebcdbdd043ad05b"><font size='3'>SimpleIdentificationInformation</font></a>

                        
                  
                  &nbsp;</td>
                  

I need to retrieve the Type value "Extension1" and "SimpleIdentificationInformation" from both files. I want just one regular expression. I wrote this one but doesn't return the data right.

$content2 =~ /Type.*\<font.+?\>(.*)\<\/font\>\<\/a\>/s){
Avatar of hernst42
hernst42
Flag of Germany image

You could try as regular expression (untested):

/Type.*\<font[^>]*\>(.*)\<\/font\>\<\/a\>/s
Avatar of saibsk
saibsk

ASKER

nope doesn't work
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial