Please help urgent.

Hi i have a string which i get after converting a Map<String, Object> to a string by calling a toString method on the map.

Now i want to reconstruct the Map<String,String> by the String which i created earlier. How can i do it with regularexpression ? please help the patter will look like {Hello2=hi2, hello1=hi1}

Message was edited by:

hi_all

[382 byte] By [hi_alla] at [2007-11-27 10:10:34]
# 1
Is it really, really urgent? Or just mildly urgent?
cotton.ma at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 2
I know how to do it with for loop but not with regular expressions. Can you please help
hi_alla at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 3
You will only get help if you can provide an answer to these questions:Why should we drop everything to help you?What makes you more important than everyone else asking for help?
floundera at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 4
could you post your code...note: next time don't post with a title "Please help urgent"
Yannixa at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 5

* Your subject line contains no useful information at all.

* You tried to foist your urgency off on those who would help you, even though that urgency is yours alone.

* You showed no evidence of having tried anything yourself.

Therefore, I, for one, will not even consider helping you. Maybe somebody else will, maybe not. Good luck.

jverda at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 6
Somehow I'm guessing he won't label his next post "urgent"
petes1234a at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 7
> Somehow I'm guessing he won't label his next post> "urgent"We'll see. There's been no shortage of stubborn people and slow learners here so far.
jverda at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 8
I'd like to see them enitile their threads "FREE BEER!"
floundera at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 9

> Hi i have a string which i get after converting a

> Map<String, Object> to a string by calling a toString

> method on the map.

> Now i want to reconstruct the Map<String,String> by

> the String which i created earlier. How can i do it

> with regularexpression ? please help the patter will

> look like {Hello2=hi2, hello1=hi1}

Now let me ask a simple question first: Why did you discard that Map in the first place if you needed to use it again?

aniseeda at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 10

> > Hi i have a string which i get after converting a

> > Map<String, Object> to a string by calling a

> toString

> > method on the map.

> > Now i want to reconstruct the Map<String,String>

> by

> > the String which i created earlier. How can i do

> it

> > with regularexpression ? please help the patter

> will

> > look like {Hello2=hi2, hello1=hi1}

>

> Now let me ask a simple question first: Why did you

> discard that Map in the first place if you needed to

> use it again?

Because he wants a different Map. One is String, Object and the new one is String, String

Maybe.

cotton.ma at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 11
pointlessly futile question anyway. You can't get there from here, or even if you could why would you?
ejpa at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 12
No, good question.I think in some cases it can be useful to convert a map to a string and later rebuild the map from a string.For example when multiple sort of data have to be stored in a file, with generic save and load functions that take only strings.
tom_jansena at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...
# 13

... and if all the objects can be losslessly and unambiguously converted to Strings and back, which requires that they contain no binary data, which cuts out 99% of the useful data formats in the world ... and as long as you don't mind the parsing and space overheads ...

Java does already contain Serialization and XML for this kind of thing.

And there is no evidence the OP is round-tripping through a file. Maybe he is just tripping ...

I would keep hold of the original Map myself and wreak some magic on it.

ejpa at 2007-7-13 0:47:27 > top of Java-index,Java Essentials,Java Programming...