betweenResultLast method
Same as betweenResult but searches from the end.
Implementation
(String, String?)? betweenResultLast(
String start,
String end, {
bool endOptional = true,
bool trim = true,
}) {
if (isEmpty) return null;
final String found = betweenLast(start, end, endOptional: endOptional, trim: trim);
if (found.isEmpty) return null;
final String removed = replaceFirst(start + found + end, '');
final String remaining = trim ? removed.replaceAll(RegExp(r'\s+'), ' ').trim() : removed;
return (found, remaining);
}