[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

challenge - regex which matches nothing

Ara.T.Howard

12/15/2005 7:59:00 PM

8 Answers

dblack

12/15/2005 8:03:00 PM

0

Mike Fletcher

12/15/2005 8:15:00 PM

0

unknown wrote:
> this is the best i've come up with
>
> %r/^(?!.*)$/m

%r/\z\A/ ?

--
Posted via http://www.ruby-....


C Erler

12/15/2005 8:20:00 PM

0

On 15/12/05, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
>
>
> this is the best i've come up with
>
> %r/^(?!.*)$/m
>
> comments?
>
> -a
> --
> ===============================================================================
> | ara [dot] t [dot] howard [at] noaa [dot] gov
> | all happiness comes from the desire for others to be happy. all misery
> | comes from the desire for oneself to be happy.
> | -- bodhicaryavatara
> ===============================================================================
>
>
>

/\1/ seems to work.


Ara.T.Howard

12/15/2005 8:36:00 PM

0

Ara.T.Howard

12/15/2005 8:37:00 PM

0

Bob Showalter

12/15/2005 8:42:00 PM

0

ara.t.howard@noaa.gov wrote:
> On Fri, 16 Dec 2005, C Erler wrote:
>> /\1/ seems to work.
>
>
> you win the golf contest i think... that seems to be the shortest
> possible...

Same number of chars:

/.^/


Ara.T.Howard

12/15/2005 8:50:00 PM

0

Chad Perrin

12/15/2005 8:56:00 PM

0

On Fri, Dec 16, 2005 at 05:50:04AM +0900, ara.t.howard@noaa.gov wrote:
> On Fri, 16 Dec 2005, Bob Showalter wrote:
>
> >ara.t.howard@noaa.gov wrote:
> >>On Fri, 16 Dec 2005, C Erler wrote:
> >>>/\1/ seems to work.
> >>
> >>
> >>you win the golf contest i think... that seems to be the shortest
> >>possible...
> >
> >Same number of chars:
> >
> > /.^/
>
>
> it's 'smaller' too...

. . and "cuter".

--
Chad Perrin [ CCD CopyWrite | http://ccd.ap... ]

unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.