From: 7stud -- Date: 2009-08-27T19:15:55+09:00 Subject: Re: regexp which matches nothing? 7stud -- wrote: > 7stud -- wrote: >> Joao Silva wrote: >>> How i can construct regexp, which will always matches nothing? >>> >>> For example: >>> >>> "xxxxxxx".match /my_special_regexp/ >>> => should be ALWAYS nil >> >> How about: >> >> re = /$a^/ > > I guess that could be made even simpler: > > re = /a^/ ..and probably more efficient: re = /a\A/ -- Posted via http://www.ruby-forum.com/.