如何使用 RegEx 从以下响应中提取 userId 值

how to extract userId values from below response using RegEx

如何使用 RegEx

从下面的代码响应中提取 userId
{"errorId":0,"errorLongDesc":"Data Successfully saved","errorDesc":"success","user":{"userId":3706}}

不建议通过正则表达式来完成,但如果您找不到其他选择:

(?<="userId":)\d+

此处演示:https://regex101.com/r/kZ4tQ7/2