Daniel Vöěkerts wrote:

> <165> Aug 16 17:01:35 localhost Just a test
> I was trying to reach this form
> 
> var = content
> 
> pri = 165
> timestamp = Aug 16 17:01:35
> device = localhost
> msg = Just a test

This ought to work, but there might be other ways to do this:

if md = /^<(\d+)> (\S+ \d+ \d+:\d+:\d+) (\S+) (.*?)$/.match(text)
   pri, timestamp, device, msg = *md.captures
   # Do something with the captures
end

Regards,
Florian Gross