gpt4 book ai didi

java - 复杂字符串数据提取

转载 作者:行者123 更新时间:2023-12-02 00:18:27 24 4
gpt4 key购买 nike

我想从给定的字符串中提取数据,我已经成功做到了,但遇到了一些困难。

我给你两个字符串:

"ESS23300RGR","Boorum & Pease 23 Series Columnar Book, Record, 300 Page, Black/Red (23-300-R)","UnbeatableSale, Inc (Amazon Marketplace)","180.80","6.09","http://www.amazon.com/gp/offer-listing/B000DLBVU4/ref=olp_page_next?ie=UTF8&shipPromoFilter=0&startIndex=15&sort=sip&me=&condition=new","http://www.amazon.com/gp/offer-listing/B000DLBVU4/ref=olp_page_next?ie=UTF8&shipPromoFilter=0&startIndex=15&sort=sip&me=&condition=new"
"WLJ36210WGR","Basic Round Ring View Binder, 362 Line, 3 Ring, 1" Capacity, 8-1/2" x 5-1/2" Sheet Size, White","Gov Group (Amazon Marketplace)","3.61","7.70","http://www.amazon.com/gp/offer-listing/B0006OF55A/ref=olp_seeall_fm?ie=UTF8&shipPromoFilter=0&startIndex=0&sort=sip&me=&condition=new","http://www.amazon.com/gp/offer-listing/B0006OF55A/ref=olp_seeall_fm?ie=UTF8&shipPromoFilter=0&startIndex=0&sort=sip&me=&condition=new"

这是我使用的表达式:regexChecker("[\w\s&\(\)-^,]{3,}", longString);

使用它,我成功地分离了第一个字符串,但第二个字符串却没有,因为它使用 , 和 "作为某些部分的一部分。

如何从第二个字符串中提取与第一个字符串类似的数据?

需要提取的数据是:SKU、名称、竞争对手、价格、运费、URL、SourceURL

提前致谢。

最佳答案

尝试:

String[] tabS = myLine.substring(1, myLine.lenght() -1).split("\",\"");

删除所有重要的"

关于java - 复杂字符串数据提取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11469727/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com