如何从 Alteryx 中的 html 标签中提取数字?

How to extract number from html tags in Alteryx?

我有一个包含如下数据列的抓取数据集:

<td>1,968</td>
<td>185</td>
<td>1,285<sup id="cite_ref-4" class="reference"><a href="#cite_note-4">[4]</a></sup></td>

我正在使用 Alteryx to process the data and I want to use regex to extract the number between the html tags <td> and </td>. So in the above case, I am supposed to get back 1968, 185 and 1285. I tried the following regular expressions, but neither worked using this tester。我相信正则表达式的版本应该是 Alteryx 的 R,但不确定。

>([0-9]+)<

>[0-9]+<

有人可以解释一下吗?谢谢!

另一种 Alteryx 方法:使用公式工具删除 <td> 以及逗号和空格,然后使用 Select 工具将剩余的内容转换为您选择的数字类型。 . 它会自动获取第一个非数字字符之前的所有内容。