Skip navigation
Currently Being Moderated

Optional word in regex

Feb 18, 2012 8:16 AM

Tags: #regex

Hi,

 

I need some help in doing a regex find.  I want to find the content of a <td> tag.  However, the content might be enclosed by <span> tag. 

 

<td>abc</td>

<td><span>abc</span></td>

 

How do I write the regex that can capture abc in either situation? 

 

 

Thank you!

 
Replies
  • Currently Being Moderated
    Feb 18, 2012 3:38 PM   in reply to minli98

    Write two, and use or logic.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points