chickadee » irregex » string->sre

string->sre <str>procedure
maybe-string->sre <obj>procedure

For backwards compatibility, procedures to convert a POSIX string into an SRE.

maybe-string->sre does the same thing, but only if the argument is a string, otherwise it assumes <obj> is an SRE and returns it as-is. This is useful when you want to provide an API that allows either a POSIX string or SRE (like irregex or irregex-search below) - it ensures the result is an SRE.