Here's mine though a little more complicated
Code:
$Wc2Re(wildcard text) -> Converts a wildcard matching pattern to a regular expressions
$Wc2Re(wildcard text).cs -> THe return regular expression is case sensitive

alias Wc2Re return $+(/(*UTF8)^,$regsubex($1-,/([\Q$^|[]{}()\/.+\E])|(&(?= |$))|([?*]+)/g,$Wc2Re:Rep(\t)),$,/s,$iif($prop != cs,i))

alias -l Wc2Re:Rep {
  if ($1 == &) return \S+\b
  if (* !isin $1 && ? !isin $1) return \ $+ $1
  if (? !isin $1) return .* 
  if ($count($1,?) < 5) return $str(.,$v1) $+ $iif(* isin $1,+)
  return $+(.,$chr(123),$count($1,?),$iif(* isin $1,$chr(44)),$chr(125))
}

$wc2re(a* t?est o? w?*?s has occ?????????) = /(*UTF8)^a.* t.est o. w..+s has occ.{9}$/si

edited to shorten code, and fix typing errors

Last edited by FroggieDaFrog; 19/01/11 01:23 PM.