From: Robert Klemme Date: 2005-12-24T01:47:51+09:00 Subject: Re: Quick Regex Query Neowulf wrote: > Hi all, > > Really quick one for the regex gurus... > > Anyone know of a regex string which will extract out the stuff between > "from" and "not" without the spaces between? > > User root from toronto-hs-216-138-233-211.s-ip.magma.ca not allowed > because not listed in AllowUsers > > I've found something which *almost* does the job... > > \bfrom\W+(?:\w+\W+){1,6}not\b host_name = /from\s+(\S+)\s+not/ =~ s && $1 > This is limited however, as I can't know for certain how many "words" > will make up the hostname. But there won't be any whitespace in the hostname, right? Then the RX above will do it. Kind regards robert