2021年1月1日星期五

regex match comma not within any parentheses or brackets

i want to match every comma in the following that isn't within parentheses or brackets. Ive put a v over the targets i want to match

   v    v           v           v                                          v  1u8, 2u8, [3u8, 4u8], (5u8, 6u8), (3u8, 4u8, 5u8, (5u8, 5u8), [6i32, 7i32]), 3u8  

I've tried myself for several hours and also tried multiple different solutions from stack overflow that claim to solve exactly this, but none of them seem to do what i want. the end goal here is to parse the values of a tuple/array from a string

https://stackoverflow.com/questions/65535393/regex-match-comma-not-within-any-parentheses-or-brackets January 02, 2021 at 09:54AM

没有评论:

发表评论