我无法弄清楚的简单正则表达式问题 [英] Simple Regex problem that I just CAN'T figure out

查看:45
本文介绍了我无法弄清楚的简单正则表达式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的问题,我需要通过以下字符串进行解析:

I have quite a simple problem, I need to parse through this string:

"user_id" => "BXoVWYg-T_QS"

仅抓取 BXoVWYg-T_QS

到目前为止,我已经使用正则表达式从更大的字符串中获取了很多东西,但是我不知道如何将其简化为仅user_id字符串的内容

I have used regex thus far to grab that much from a much larger string, but I can't figure out how to get it down to just the contents of the user_id string

这是我到目前为止拥有的正则表达式:

This is the regex I have so far:

"user_id" => ".*"

请帮助!

更新,我有一个HTML字符串,我正在尝试为Objective-c中的iPhone应用程序解析该字符串.如果我可以简化正则表达式的语法,我的问题就可以解决

Update I have a string of html that I am trying to parse through for an iPhone app in objective-c. If I can just get the regex syntax down, my problems will be solved

推荐答案

"user_id" => "([^"]*)"

这篇关于我无法弄清楚的简单正则表达式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆