How to get regex inner html in ubot studio -


hi have text inside ubot studio trying scrape function use find regular expresion , list item this:

 <td class="amt base">         $136    </td> 

how can $136 regex? tried use following:

<td class="amt base">(.*)</td> <td class="amt base">(*)</td> <td class="amt base">*</td> 

but none of them seem work. alot sharing regex knowladge.

how /s

/(?:<td class="amt base">)(.*)(?:<\/td>)/s 

online demo

  • /s treat string single line. change change .* match character whatsoever, newline, not match.
  • ?: none matching group optional here added make single group match.
  • \/ important scape \ have special meaning in regex.

important: did not see language specified in post , /s may not supported languages javascript or ruby.

update

even though uncertain if work input value try this:

online demo 2

/(?:<td class="amt base">\s+)(.*)(?:\s+<\/td>)/ 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -