python 正则提取内容

python 正则提取内容

a = """
"productLadderPrices": [

{"formatPrice": "$1.26", "max": 1999, "min": 1000, "price": 1.26},

{"formatPrice": "$1.15", "max": 4999, "min": 2000, "price": 1.15},

{"formatPrice": "$0.98", "max": 19999, "min": 5000, "price": 0.98},

{"formatPrice": "$0.62", "max": -1, "min": 20000, "price": 0.62}

]
"""

上面这段字符串,我要提取中刮号里的内容,也就是"productLadderPrices":[]里面的内容,用python re正则表达式要怎么写呢?


回答:

这结构再套上一对大括号就是良好json结构了, 还用啥正则. 直接解析json比较好.

以上是 python 正则提取内容 的全部内容, 来源链接: utcz.com/p/938276.html

回到顶部