RegEX : Can't get SUCCESS to capture HTML

Hi All ,

My question is quite simple , i wanna display and capture the word:
"Hello Michael Jackson "

The HTML Code:

<table class="ox-5061a58cd7-spacer" style="border: none; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">
  <tbody>
    <tr style="padding: 0; text-align: left; vertical-align: top;">
      <td align="center" valign="top" height="20px" style="margin: 0; border-collapse: collapse; color: #001d2f; font-size: 20px; font-weight: normal; line-height: 20px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word;"> &nbsp;</td>
    </tr>
  </tbody>
</table>

<h3 class="ox-5061a58cd7-h3-text" style="font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 0;">   Singer: </h3>

" Hello Michael Jackson "

<table class="ox-5061a58cd7-spacer" style="border: none; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;">

RegEx Code 1 to display this on screen:

"<h3 class=\"ox-5061a58cd7-h3-text\" style=\"font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 0;\">Singer:(.*)</h3>"

RegEx Code 2:

(?<=Singer:</h3>).+(?=<\table>)

Thank for EVERY expert in RegEx to let me get SUCCESS and FIX this problem

Updating Code :

Regex Code 3:

(Singer:([^.]*)

it’s display ALL HTML data after " Hello Michael Jackson "

=================================

Debug :

  <!-- DATA -->
      Hello Michael Jackson


<table role="presentation" class="spacer" style="border: none; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%">
  <tbody>
    <tr style="padding: 0; text-align: left; vertical-align: top">
      <td align="center" valign="top" height="20px" style="-moz-hyphens: auto; -webkit-hyphens: auto; margin: 0; border-collapse: collapse !important; color: #001d2f; font-size: 20px; font-weight: normal; hyphens: auto; line-height: 20px; margin: 0; mso-line-height-rule: exactly; padding: 0; text-align: left; vertical-align: top; word-wrap: break-word"> &#xA0;</td>
    </tr>
  </tbody>
</table>

I wanna just display " Hello Michael Jackson " , but i got no SUCCESS
My Regex Code 3 updated is: (Singer:([^.]*)

Is what after " Hello Michael Jackson " dynamic, if not, why would you need RegEx ?

1 Like

After that’s it’s :

<table role="presentation

i try code

(Singer:([^.]*)
(Singer:([^,]*)

it don’t capture " Hello Michael Jackson "

You don’t need RegEx if previous part is not dynamic:
Left Delim : Singer: </h3>
Right Delim : <table role="presentation

1 Like

Thanks Xanathos
How will be this code in RegEx format ?

try this:

DATA -->[\s]+([^>]*)[\s]+[\s]+[\s]+<table role="presentation

output:[1]

1 Like