queryWithRegexFirst method
Extracts the first match using a regular expression pattern.
Returns the first matching text content, or null if no matches found.
Implementation
String? queryWithRegexFirst({
required String pattern,
int group = 1,
}) {
List<String> results = queryWithRegex(pattern: pattern, group: group);
return results.isNotEmpty ? results.first : null;
}