Hello Vadim,
Thanks for replying.
> Simple regexp:
> ^key is = ([:alphanum:]*), value is = ([:alphanum:]*)$
>
> Will return you two parens, first one is value for param1, and second
> one is value for value1. Put values in the map, and you are done. You
> can also define generic paren list -> values map mapping (and store it
> in separate string, not in regexp itself), and use this mapping to
> populate result map from paren list:
> String[] map = { null, "param1", "value1" };
> for (...) results.put(map[i], re.getParen(i));
Doubt had lingered after reading this (I worried for optional parts), but
quickly went away after having a success with:
^key is = ([:alnum:]*)( auto)?, value is = ([:alnum:]*)$
giving
("key", null, "val") for "key is = key, value is = val"
and ("key", " auto", "val") for "key is = key auto, value is = val"
I guess my enhancement was indeed useless, oh well, maybe next time :)
Thanks :)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]