简体   繁体   中英

Java regex on TSV for capturing groups

I am trying to use a regex on a TSV to get every element into a capturing group (sounds simple, and I think it should be). Basically I have a 58 column TSV file, and I want to get each value into a group. So for a regex, I'm literally just doing (.+)\\t 58 times but I can't seem to grab the values.

Is this the best way to do it? I want to later on access the capturing groups by their index.

Thanks

I think it will be easier to analyze this TSV file line by line and just split this line on \\t character. This solution will be more elegant. If you really want to use regex please look here - this article describes recursive regex expression.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM