提取特定文本后的字符串,直到数据框中非常大的字符串中的下一个引号为止

时间:2019-05-08 08:33:39

标签: r regex stringr

以下是我要执行的示例:

r数据帧的一列中的每个单元格均为以下形式的字符串:

我需要提取每个名称前面的引号之间的字符串以及每个连续名称之间的4 raw_prices(如果存在)。

有一个名为:名称的单元格 [{“街区”:“名称”:“带阳台的一卧室公寓” ,“ roomtype_id”:1,“ has_room_inventory”:1,“ id”:100569304},{“ has_room_inventory”: 1,“ roomtype_id”:9,“ blocks”:[{“ max_persons”:2,“ price”:“ 106.92”,“ raw_price”:“ 106.92” ,“ rate_is_genius”:0,“ mealplan_included_name“:”早餐“,” stay_prices“:[{” price“:”“,” raw_price“:”“ ,” stays“:0,” local_price“:0},{“ raw_price”:“ 106.92” ,“ price”:“ 106.92”,“ stays”:1,“ local_price”:106.92}],“ cancellation_type”:“特殊条件”,“ rate_is_cug_business_rate”:0“,” business_package_match“:0,” nr_stays“:1,” block_id“:” 100569321_121301353_0_1_0“}], “名称”:“预算无景双人间” ,“ id”:100569321},{“街区”:[{“价格”:“ 118.80”,“原始价格”:“ 118.80 “ ,” max_persons“:2,” mealplan_included_name“:”早餐“,” rate_is_genius“:0,” stay_prices“:[{” local_price“:0,” stays“:0,” raw_price“ :“” ,“ price”:“”},{“ stays”:1,“ local_price”:118.8,“ price”:“ 118.80”,“ raw_price”:“ 118.80” },{“ raw_price”:“ 237.60” ,“ price”:“ 237.60”,“ stays”:2,“ local_price”:237.6}],“ cancellation_type”:“特殊条件”,“ rate_is_cug_business_rate“:0,” business_package_match“:0:” block_id“:” 100569307_121301353_2_1_0“,” nr_stays“:2}],” roomtype_id“:9,

Expected Output https://imgur.com/a/a8Bf6oT

0 个答案:

没有答案