Regular expression to Extract mac address and wireless network id in java
Posted on 2010-11-23
I need an expression to extract mac address and wireless network id:
Right now I use the following code (I have posted the code fragment)
Pattern pattern = Pattern.compile("(.*):(.*)");
Matcher matcher = pattern.matcher(Csid);
bssid = matcher.group(1);
Csid is the String contain mac address and ssid.
But this code does not work when there is no wireless network id present, for example:
Please give me an expression to parse and extract both and the code fragment.
It should extact both.