I have a string as mentioned below, basically data is coming to me in excel file. Some rows are proper data and for these proper data rows I am able to fetch what I need using the lua pattern. Below is the proper data row
2011/02 ARRTC AAUUMCO ZZITNWMOBILE COMMUNICATIONS CENTER ARRTC-AAUUM-TBT-2011-02 0.00 AAUUM_ARRTC_0211_TBT 18.03 18.03 EUR 1.14977 20.73 20.73
and I am using below pattern and everything is working fi开发者_开发百科ne.
rPattern = "(%d%d%d%d%/%d%d)%s*(%w%w%w[%w%d][%w%d])%s*(%w%w%w[%w%d][%w%d]).-[%u%d%-%s]-([%d%.%,]+)%s*([%u%d_%-]-)%s*([%d%.%,]+)%s*([%d%.%,]+)%s*(%u%u%u)%s*(%d+%.%d*)%s*(.-)\n"
Now some rows are coming with HTML tags, means my data is inside the html tags. The only trick I need is to fetch my required string within the HTML tags. the bugged row is
2011/02 ARRTC AAUUMCO ZZITNWMOBILE COMMUNICATIONS CENTER ARRTC-AAUUM-TBT-2011-02 0.00 <a href="/cgi-bin/recon_detail?rectent=AAUUM&benificary=ARRTC&period=2011/02&svctype=Voice">AAUUM_ARRTC_0211_TBT</a> 18.03 18.03 EUR 1.14977 20.73 20.73
now from the above row I want to fetch AAUUM_ARRTC_0211_TBT
I am trying trying and trying but unable to do it. Can somebody will help me to fix my above patternd?
Thanks
Try print(str:match(">(.-)<"))
.
Lua pattern matching is incapable of parsing HTML. While the ">(.-)<" pattern would work in this particular instance, it would not be a general solution for arbitrary HTML.
精彩评论