getClassAndMethodName method

String? getClassAndMethodName(
  1. String input
)

Implementation

String? getClassAndMethodName(String input) {
  // Regex Explanation:
  // #\d+\s+           -> Matches "#3" followed by whitespace
  // ([^\s]+)          -> CAPTURE Group 1: Matches everything that is NOT a space (Class.Method)
  // \s+\(             -> Matches the space before the opening parenthesis (stop capturing here)
  final regExp = RegExp(r'#\d+\s+([^\s]+)\s+\(');

  final match = regExp.firstMatch(input);

  if (match != null) {
    return match.group(1);
  }
  return null;
}