createRegexp function

RegExp createRegexp(
  1. Link profileMatch,
  2. Config config
)

Implementation

RegExp createRegexp(Link profileMatch, Config config) {
  String match = profileMatch.match;
  if (profileMatch.idPattern?.isNotEmpty == true) {
    match = match.replaceAll('{PROFILE_ID}', profileMatch.idPattern!);
  }
  match = match.replaceAll('{PROFILE_ID}', profileId);
  return RegExp([
    '^',
    match,
    config.filterForQueryParams || profileMatch.forceStripQuery == true
        ? queryParam
        : '',
    r'$'
  ].join(''));
}