regex - Regexp for parsing a string -


hello have troubles in parsing these strings (num of columns fixed)

 9/01 down/down 0/ 0 0/ 0 0/ 0 0/ 0 0%/ 0%      9/01 up/ 33172/100014 65/ 111 -106/ 136 33172/100014 100%/100% 

the final result should matrix like:

9/01 | down/down | 0/ 0         | 0/ 0    |  0/ 0      |  0/ 0          |  0%/ 0% 9/01 | up/    | 33172/100014 | 65/ 111 |  -106/ 136 |  33172/100014  |  100%/100% 

could me in writing regexp single input line?

riccardo

edit: temp solution: [^/]+/[\s]*[^\s]+

ahh lot better. @ndn proud of, think. :p

([\w\/%\-\s]+?)(?:\b\s|$) 

regex101

if want captured in line right away separate capture groups can use this:

(\d+\/\d+)\s+(\w+\/\s?\w+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-%]+\/\s?[\d%]+) 

regex101


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -