All pastes #109660 Raw Edit

Stuff

public text v1 · immutable
·published 2006-08-01 07:29 UTC
rendered paste body
alias stripwm { 
  if ((!$1) || (!$2)) || (!$isid) return 
  var %r = $+(/,$chr(40),$regsubex($regsubex($regsubex($regsubex($2,/(\.|\?|\+|\[|\]|\^|\$|\\)/g,\\t),/\*$/,*$),/^\*/,^*),/\*/g,$+(.*,$iif(f isin $prop,?))),$chr(41),/g)
  if (r isin $prop) { 
    var %t = $regex(stripwm,$1,%r) , %m = $regml(stripwm,0) , %x = 1 , %return
    while (%x <= %m) {
      %return = $instok(%return,$regml(stripwm,%x),%x,$iif($regsubex($prop,/\D/g,),$v1,44))
      inc %x
    }
    return %return
  }
  return $regsubex($1,$+(%r,g),)
}

/* Lets try it */
//echo -a$stripwm(tom hello tom,t*m)
that echos hello and nothign else