Editing 1638: Backslashes

Jump to: navigation, search

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 16: Line 16:
 
This doubling of backslashes happens in most programming and scripting languages, but also in other syntactic constructs such as {{w|Regular expression|regular expressions}}. So, when several of these languages are used in conjunction, backslashes pile up exponentially (each layer has to double the number of slashes). See example of a backslash explosion and alternatives to avoid this [[#Backslash explosion and alternatives|below]].
 
This doubling of backslashes happens in most programming and scripting languages, but also in other syntactic constructs such as {{w|Regular expression|regular expressions}}. So, when several of these languages are used in conjunction, backslashes pile up exponentially (each layer has to double the number of slashes). See example of a backslash explosion and alternatives to avoid this [[#Backslash explosion and alternatives|below]].
  
βˆ’
This kind of backslash explosion is known as {{w|Leaning toothpick syndrome}}, and can happen in [[1313: Regex Golf|many situations]]. Below is an explanation of all the [[#Entries in the list|entries in the comic]].
+
This kind of backslash explosion is known as {{w|Leaning toothpick syndrome}}, and can happen in many situations. Below is an explanation of all the [[#Entries in the list|entries in the comic]].
  
 
The backslash explosion in the title text is about a {{w|Bash (Unix shell)|bash}} command (which uses the backslash to escape arguments) invoking the {{w|grep}} utility which searches for text following a pattern specified by means of a regular expression (which also uses the backslash to escape special characters). This leads to 3 backslashes in a row in the command, which could easily become 7 backslashes in a row if the text being searched for also contains a backslash.
 
The backslash explosion in the title text is about a {{w|Bash (Unix shell)|bash}} command (which uses the backslash to escape arguments) invoking the {{w|grep}} utility which searches for text following a pattern specified by means of a regular expression (which also uses the backslash to escape special characters). This leads to 3 backslashes in a row in the command, which could easily become 7 backslashes in a row if the text being searched for also contains a backslash.

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)