简体   繁体   English

使用TRegex提取HTML代码的值

[英]Extract value of HTML code using TRegex

How can get the value part only of this HTML code using TRegex: 如何使用TRegex获得仅此HTML代码的值部分:

<input type="hidden" name="authenticityToken" value="56e8af5e4491c1b18472e9ab0e40570b73222499">

I'd like to extract 我想提取

56e8af5e4491c1b18472e9ab0e40570b73222499

only. 只要。

Regex is not the best tool for this but if you want: 正则表达式不是最好的工具,但是如果您愿意:

<input\s(?=[^>]*?name="authenticityToken").*?value="([^"]+)"

The value is stored in group 1 该值存储在组1中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM