How would I create a java.util.UUID from a string with no dashes?
\"5231b533ba17478798a3f2df37de2aD7\" => #uuid \"5231b533-ba17-4787-98a3-f2df37de2aD7\"
<
Another solution would be something similar to Pawel's solution but without creating new Strings and only solving the questions problem. If perfomance is a concern, avoid regex/split/replaceAll and UUID.fromString like the plague.
String hyphenlessUuid = in.nextString();
BigInteger bigInteger = new BigInteger(hyphenlessUuid, 16);
new UUID(bigInteger.shiftRight(64).longValue(), bigInteger.longValue());