Editing Talk:1313: Regex Golf

Jump to: navigation, search
Ambox notice.png Please sign your posts with ~~~~

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 68: Line 68:
  
 
For the Star Wars/Star Trek golf, including the new films, I've got /m | [tn]|ba|a[sw]/. Can anyone do better? {{unsigned|Misterblue28}}
 
For the Star Wars/Star Trek golf, including the new films, I've got /m | [tn]|ba|a[sw]/. Can anyone do better? {{unsigned|Misterblue28}}
:Including Star Wars films up to ''The Rise of Skywalker'', I get /ke|a.t.|n.*h/. --[[Special:Contributions/172.69.63.47|172.69.63.47]] 20:46, 20 May 2019 (UTC)
 
Does this work for Trump v Hillary? {{unsigned ip|162.158.154.103}}
 
: I was just wondering the same thing. Pretty sure it's now literally impossible, since you'd have to both match AND exclude "Clinton". [[Special:Contributions/162.158.75.88|162.158.75.88]] 13:15, 2 October 2018 (UTC)
 
 
== Regex golf with transcript ==
 
 
So I decided to play regex golf with the transcript (after learning regex) and it was kinda fun.
 
Here's my list of lines to match:
 
 
[Megan is sitting at a laptop. Cueball is standing behind her.]
 
 
Megan: /m | [tn]|b/ matches Star Wars subtitles but not Star Trek.
 
 
[A close-up of Megan at her laptop.]
 
 
Cueball (offscreen): Uh oh...
 
 
[Megan typing at her laptop.]
 
 
[Cueball facepalming.]
 
 
[Another closeup of Megan at her laptop.]
 
 
Cueball: Now you have infinite problems.
 
 
 
Here's my list of lines not to match:
 
 
Regex golf:
 
 
Megan: You try to match one group but not the other.
 
 
Cueball: Cool.
 
 
Meta-regex golf:
 
 
Megan: So I wrote a program that plays regex golf with arbitrary lists...
 
 
Meta-meta-regex golf:
 
 
Megan: ...But I lost my code, so I'm grepping for files that look like regex golf solvers.
 
 
...And beyond:
 
 
Megan: Really, this is all /(meta-)*regex golf/.
 
 
Megan: No, I had those already.
 
 
And here's my (very bad) regex.
 
\[|ms|h\.
 
(Hey, I learned yesterday)[[Special:Contributions/162.158.255.34|162.158.255.34]] 16:40, 17 October 2019 (UTC)
 
 
Wanted to drop this hairball from earlier:
 
    \/\/([^\n]|\\\n?)*$(?<!\\$)|\/\*(([^\/*]|\*(?!\/))*)\*\/
 
{{User:PoolloverNathan/Signature}} 17:29, 4 November 2022 (UTC)
 

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)

Templates used on this page: