Editing Talk:1638: Backslashes

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 237: Line 237:
 
This makes hardly more sense than the original command.
 
This makes hardly more sense than the original command.
 
--[[User:Markus|Markus]] ([[User talk:Markus|talk]]) 17:38, 9 February 2016 (UTC)
 
--[[User:Markus|Markus]] ([[User talk:Markus|talk]]) 17:38, 9 February 2016 (UTC)
:Randal may have been sincere about finding it in his history and wondering if it worked. I think he probably meant
 
cat out.txt | grep -o "[[(].*[])][^])]*$"
 
 
:which breaks down as:
 
[[(]  either a '[' or a '('
 
.*    an unbounded and possibly empty sequence of arbitrary characters
 
[])]  either a ']' or a ')'
 
[^])]*  any number of any characters except for a ')' or ']'
 
$    anchored at end of line
 
 
:This matches any line that has a '[' or '(' followed by a ')' or ']', matching from the first '[' or '(' to the end of the line. The final part of the regex, '[^])]*$', is not really necessary here, but it is a common pattern to follow a character pattern with an opposite character pattern to be sure the first character pattern matches the last instance of a repeating character, so he might have added it out of habit, which would explain also why he got it wrong (since he just followed '[blah]' with '[^blah]' which in this special case doesn't work because 'blah' has a special character in it: ']').
 
:[[User:Jgro|Concerned Netizen]] ([[User talk:Jgro|talk]]) 02:23, 25 April 2017 (UTC)
 
 
----
 
----
 
Funny enough, I'm literally looking at some other dev's code right now that actually implements an eight backslash regex sequence, with just the comment "backslash". I'm still scratching my head over what they were trying to accomplish or even communicate with this. [[User:Domino|Domino]] ([[User talk:Domino|talk]]) 21:45, 16 August 2016 (UTC)domino
 
Funny enough, I'm literally looking at some other dev's code right now that actually implements an eight backslash regex sequence, with just the comment "backslash". I'm still scratching my head over what they were trying to accomplish or even communicate with this. [[User:Domino|Domino]] ([[User talk:Domino|talk]]) 21:45, 16 August 2016 (UTC)domino

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: