parameter = Colour
default = 0
highlight = 0
crossfade = 1
type = ltp8bit
range = 242, 254, spin >>
range = 0, white
range = 16, red
range = 32, blue
range = 48, green
range = 64, yellow
range = 80, cyan
range = 96, orange
range = 112, magenta
range = 128, neon grn
range = 144, pink
range = 160, UV blue
range = 176, aqua[/code]
I already purchased RegExRx, but I seem to be kinda to dumb to find my way through regEx at the moment… haha… Is there any way to get data sorted in groups like with {parameter} or something?
No biggie, I can do most of it right from RegExRX:
dim params() as string
dim values() as string
dim rx as new RegEx
rx.SearchPattern = "(?mi-Us)^([^=\\r\
]+) = (.+)$"
dim match as RegExMatch = rx.Search( sourceText )
while match <> nil
params.Append rx.SubexpressionString( 1 )
values.Append rx.SubexpressionString( 2 )
match = rx.Search()
wend
This will give you arrays with the parameters and matching values.
ummm you really don’t need a regex for that
that’s using a sledgehammer to crack a peanut
split the left hand side from the right using split on =
split the right hand side on , (unless of course your data includes , then you have a real problem in either case)
instr use the first one to get the “key portion”
mid past instr+1 to get the rest
heck you can get away with ^([^=])\=(.)$ for a regex IF the data is always as presented