In article <bccorf$i3gqt$1 / ID-52924.news.dfncis.de>,
Robert Klemme <bob.news / gmx.net> wrote:

>I think the problem is, that you use #{m} to insert a regexp into another:
>
>irb(main):006:0> m = /[Mm]ike/
>/[Mm]ike/
>irb(main):007:0> m.to_s
>"(?-mix:[Mm]ike)"
>irb(main):008:0> m.source
>"[Mm]ike"
>irb(main):009:0>
>
>You'd be better off if you use
>
>'mike stok' =~ /^#{m.source} #{s.source}$/
>
>or make m and s strings in the first place.

The problem with this is that .source seems to lose information (the /i
modifier, for example):

[mike@ratdog mike]$ irb --simple-prompt
>> m = /mike/i
=> /mike/i
>> 'Mike' =~ /#{m}/
=> 0
>> 'Mike' =~ /#{m.source}/
=> nil

Thanks,

Mike

-- 
mike / stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       | GPG PGP Key      1024D/059913DA 
mike / exegenix.com                  | Fingerprint      0570 71CD 6790 7C28 3D60
http://www.exegenix.com/           |                  75D2 9EC4 C1C0 0599 13DA