import { isSpecialMissing } from '@sasjs/utils/input/validators'

/**
 * HARDREGEX/SOFTREGEX both skip pattern-matching for blank and SAS special
 * missing values (., .a-.z, _) — the same exemption NOTNULL/MINVAL/MAXVAL
 * already apply elsewhere, since neither convention represents a real
 * formatted value the pattern is meant to check.
 */
export const isRegexRuleExempt = (value: any): boolean => {
  if (value === undefined || value === null || value === '') return true

  return isSpecialMissing(value)
}
