I want to use pattern that return to me the (ssid, psk, proiority) as key
and the value associated for each key.
and if there is a way to understand the expressions that i have to use
like
Pattern.compile("(\\w+?):(\\w+?),")
reply to me.
this is my String
network={
ssid="name"
psk="password"
key_mgmt=WPA-PSK
priority=1
}
network={
ssid="another name"
psk="another password"
key_mgmt=WPA-PSK
priority=1
}
Here is an ugly solution:
I put your text input into a file named
file.txtand read it through a BufferedReaderThis is my output: