ok, gotcha, this is about the matching of data-types with "_" which are not valid as identifiers in enums.Good idea!

I'd precompile the pattern though:

private static final Pattern pattern = Pattern.compile("_");
...
return valueOf(pattern.matcher(value).replaceAll("_"));