Java tutorial
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String parseOptionalStringAttr(String paramString, Pattern paramPattern) { Matcher localMatcher = paramPattern.matcher(paramString); if ((localMatcher.find()) && (localMatcher.groupCount() == 1)) return localMatcher.group(1); return null; } }