emperor: (Default)
Add MemoryShare This Entry
posted by [personal profile] emperor at 12:30am on 08/08/2008 under ,
Inspired by this t-shirt...

[Poll #1236962]
There are 23 comments on this entry. (Reply.)
 
posted by [identity profile] arnhem.livejournal.com at 11:34pm on 07/08/2008
I still think it ought to be "the string that is exactly 'bb' or any string that does not have the substring 'bb'". But I haven't got my head round the re for it yet.
lnr: Halloween 2023 (Default)
posted by [personal profile] lnr at 11:07am on 08/08/2008
Urg, you just hurt my brain.
emperor: (Default)
posted by [personal profile] emperor at 11:10am on 08/08/2008
I think [livejournal.com profile] jdev's suggestion comes close.
 
posted by [identity profile] deliberateblank.livejournal.com at 11:39pm on 07/08/2008
/b{2}|(?!b{2})/
ext_243: (hexa)
posted by [identity profile] xlerb.livejournal.com at 11:48pm on 07/08/2008
/bb|^([^b]|b[^b])*b?$/
emperor: (Default)
posted by [personal profile] emperor at 10:15am on 08/08/2008
This is good.
 
posted by [identity profile] hotbadgerdeluxe.livejournal.com at 12:45am on 08/08/2008
Bastard. I've been trying to forget regular expressions.

Bring back SCL, that's what I say.
 
posted by [identity profile] samholloway.livejournal.com at 03:22am on 08/08/2008
Said Hamlet to Ophelia,
"I'll draw a sketch of thee.
What kind of pencil shall I use?
2B or not 2B?"

- Spike Milligan
ext_27570: Richard in tricorn hat (Default)
posted by [identity profile] sigisgrim.livejournal.com at 07:39am on 08/08/2008
2b|!2b
 
posted by [identity profile] sphyg.livejournal.com at 08:31am on 08/08/2008
Yes, that's nice and succinct. I've been battling Excel formulas this week, so had to go with option 4.
emperor: (Default)
posted by [personal profile] emperor at 10:08am on 08/08/2008
Sadly, not a regular expression :)
 
posted by [identity profile] hilarityallen.livejournal.com at 10:10am on 08/08/2008
Well, I had to find Gareth for him to explain the finer points of regexps to me.
emperor: (Default)
posted by [personal profile] emperor at 10:16am on 08/08/2008
Well, they say you learn something new every day. They never specified it had to be useful ;-)
ext_27570: Richard in tricorn hat (Default)
posted by [identity profile] sigisgrim.livejournal.com at 10:37am on 08/08/2008
True, at least it's not a Perl-style reg-ex. However, it is an expression, and it seems fairly regular to me. ;-)
 
posted by [identity profile] imc.livejournal.com at 08:42am on 08/08/2008
Why the parens in those first two examples?

/bb/ || !/bb/ (doesn't really cut it as a regexp joke, I suspect).
emperor: (Default)
posted by [personal profile] emperor at 10:08am on 08/08/2008
1) is as per the t-shirt
In 2) the brackets are surperfluous, /bb|[^b]{2}/ is equivalent
 
posted by [identity profile] j4.livejournal.com at 09:02am on 08/08/2008
1. isn't that really "to be or two not-bs"[*]? I mean, I know what you mean, but it makes the pun not quite work IMHO.
2. ditto but with unnecessary brackets...
3. is "one or more 'to be's".
4. works, but could be written more concisely as /(bb)?/ surely?

A propos, I so want the regex cheat skirt. 8-)

[*] "You can't not be on a boat." "I've frequently not been on boats!" "No, what you've been is not on boats."

emperor: (Default)
posted by [personal profile] emperor at 10:05am on 08/08/2008
1) yeah, that's what's on the thinkgeek shirt, which is where all this started.
3) whups, yes, I meant that one to be /(bb)?/ not /(bb)+/
lnr: Halloween 2023 (Default)
posted by [personal profile] lnr at 11:57am on 08/08/2008
Skirt: oh wow! Shame they don't do more sizes.
gerald_duck: (ascii)
posted by [personal profile] gerald_duck at 09:48am on 08/08/2008
Ultimately, you're doomed. x or not-x is true for any x, including "to be", so is most succinctly expressed by the null regexp.

So I just ticked whichever looked most amusing without regard to rigour.
lnr: Halloween 2023 (Default)
posted by [personal profile] lnr at 11:04am on 08/08/2008
/(bb)?/ works better than /(bb)+/ surely? The latter is "at least to be"
emperor: (Default)
posted by [personal profile] emperor at 11:10am on 08/08/2008
Yeah, that was a typo (see my comment to [livejournal.com profile] j4 above).
ext_15802: (Default)
posted by [identity profile] megamole.livejournal.com at 12:50pm on 08/08/2008
Whether 'tis nobler in the compiler...

October

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
26
 
27
 
28
 
29
 
30
 
31