I have a question for the regular show

Asked 1 weeks ago, Updated 1 weeks ago, 2 views

{"_id":"PI45S5IPABZDOO34LYYK73PEM","content":"life"""text"},{"_id":66V6N5Q6NHTTB3NH3"JTHC4THCJTHC4T \"Life is hard, but don't give up\""",type":"text"},{"_id":"YMY75QVTINHRAAEJ7WCMD5AU"",content":"Today's menu is \:Fried potato vegetable stir-fried hamburger".","type":"text"}

What I want here is data between content and type The original method that I was thinking of was

$pattern = '/content":"([^:])","type/g';

However, this method causes a problem of being cut at the third time. There are a lot of things in the content, so it's hard to cut it into a regular style Content, type, and _id are not included in the text Is there any way?

For your information, I tried to use json instead of regular expression, but sometimes I can't use json because it doesn't complete with json (ex:"}" missing or containing .join()).

regex php

2022-09-20 15:57

1 Answers

It's a self-answer

(content\b)\":\"(.*?)\",\"(type\b)


2022-09-20 15:57

If you have any answers or tips

Popular Tags
python x 1522
android x 362
c x 361
java x 353
javascript x 303
php x 126
swift x 112
mysql x 92
r x 87
html x 51

© 2022 pinfo. All rights reserved.