« first day (2084 days earlier)   
00:00 - 15:0015:00 - 17:00

3:00 PM
'\\1' becomes '\1', the backslash is called as 'escaping' in this case, because backslash is already part of special characters (for \n, \t, ..). So when you want a backslash alone, you do \\
It allows also to insert quotes '\'' is valid and is ', it's like "'". And you can also use backticks, which is a more powerful feature to include variables more nicely
 
"\t" is a tab character, "\n" is a newline, "\0x20" is character with character code 20 in hex, aka 32 ASCII (UTF8) aka space character. Similarly, "\1" is character code 1 (aka SOH, a control char which is unprintable).
So if you want your string to include the two visible characters \ and 1 and not just the one non-printable character SOH, then you need to escape the backslash, using another backslash, as in "\\" which produces \ (just as "\t" produces tab), followed by "1" to produce "1", thus "\\1".
 
better explanation
 
Uh, I meant 32 ASCII. Can't seem to edit my comment.
 
3:21 PM
@caub But it's normally not necessary to escape \1 in Regex in Javascript, is it?
 
Slash-delimited patterns are compiled differently, IIRC.
So it depends how you are creating these.
The slashes appear to work as they do in Perl, granting a different interpretation of backslash escapes within their bounds.
@DanBron Actually, this is complicated. Something like /(foo)\1/ has the \1 as a backreference to the first capture group, not an octal escape like "\01" would be. In Perl it depends on whether it's in slashes or double quotes.
But really, it is more complex than this, since [\1\2] are always octals not backrefs.
 
3:37 PM
ugh, octals. Uglifying languages and introducing bugs since forever.
 
3:50 PM
@tchrist So does /(diplodocus)\1/g work as a Regex in Javascript?
I think it does?
 
@Cerberus yes
 
Notepad++ gives the entire string the proper purple colour.
OK.
Caub, formerly Crl, seemed to be suggesting that it needs to be escaped, so /(diplodocus)\\1/g
 
@tchrist Yeah, I was speaking only of string literals, not regex syntax. Using \1 in the LHS side of a s/// and $1 in the RHS bugged me for like two weeks in 1999 when I was learning Perl, but it stopped when I recognized regexen have a grammar separate from the grammar used in string interpolation.
 
If it were delimited by quotes not slashes, it would need the extra escaping.
But then you would need a separate argument for the /g as well. It's lame.
 
Right, my earlier comment should be interpreted under that constraint.
 
3:53 PM
@tchrist Oh, OK!
A separate argument to indicate that you want to carry out a global search?
 
@Cerberus Yeah.
 
OK I see.
 
@Cerberus yes, because it's outside the slashes, hence would be outside the string quotes
 
Oh, OK.
 
3:54 PM
I've never regexed in Javascript except in slashes.
 
@Cerberus In Perl6, these things are rationalized as "modifiers" or "adjectives" which semantically are named arguments to functions, but syntactically operate as postnomials /
 
@tchrist Ah OK.
@DanBron That makes sense, except the word "postnominal".
I'm not a programmer.
 
uh, suffix? but not attached?
instead of foo(1,2,global=true), you'd say foo(1,2) :global (I'm hand-waving but that's the idea)
so you get the convenience of the old /g but the rationality of function prototypes
 
@Cerberus Do you have anything in Dutch like the“f” word in English that people can use it to modify any word under the sun when they want to express anger, excitement, joy etc.?
 
@Mr.ShinyandNew安宇 Hm.. that does make sense. I'd rather cut off fours toes, than both my thumbs.
 
3:57 PM
I asked because I can’t think of a similar word in Urdu which can be used with like every other word. I don’t know about other languages. For example “fucking annoying” etc. in English. It is not like we don’t have swear words, but they are just not that compatible with other words.
 
@Mitch Nobody uses those toes anyway
 
@DanBron Okay, and what does (1,2) signify?
 
@Arrowfar You're not trying hard enough in Urdu
 
will. not. make. pun. about. Urd you too.
 
@Arrowfar We mostly use kut, "cunt". It can be attached to any word, or used separately.
 
3:58 PM
@Mr.ShinyandNew安宇 thw two outer toes on each foot. the ring and pinkie toes.
 
@Mitch Lol I am. There isn't any. It is just interesting :D
@terdon Hello terdon. How are you?
 
Hi!
 
@Cerberus Ah that one. I see.
I think "cunt" is common in Australian English too.
 
@Arrowfar Kut is not used in the exact same way as in English. It's either an exclamation, or a subject complement, or a prefix.
 
I hear they don't even find it offensive.
 
4:00 PM
Then again, English doesn't have a word that works like kut.
Each language is unique.
 
yep
 
For example, you could say in Dutch:
> I dropped the bowl. Kut!!
Or:
 
@Cerberus The normal (positional) parameters to the function. Like function quotient(float dividend, float divisor, bool integral = false) { z = dividend / divisor; if not integral then return z else return round(z) end }.
 
> I dropped the bowl. That is really kut!!
 
...unique in how it creates taboo words out of anatomy and digestion and animals
 
4:01 PM
Or:
> Today really is a kutday.
 
Tuesday is like that
 
@Arrowfar dunno about Dutch but there are equivalent universal modifiers in Greek (κώλο-), Spanish (puto- or X de mierda, both are essentially the same in Catalan) and French (putain de) at least.
 
'puta de mierda'
 
so you'd say quotient(22,7) and get 3.14... but if you said quotient(22,7) :integral you'd get 22 .
 
@Cerberus Shit?
 
4:02 PM
@terdon But all of those are slightly different in their use, right?
@terdon Quite similar actually, yes.
 
@Cerberus Kinda, but they can all be used where in English one would say fucking X
 
We also use English shit that way in Dutch, and also fuck and fucking.
 
@DanBron stay on topic: kutient de mierda
 
And also a backtranslation, neuk for fuck.
@terdon Ah OK, to modify an adjective or noun, yes.
 
@Mitch Can't, I'm isolated on The Lonely Island of Monolinguals.
 
4:03 PM
@terdon I see, interesting. I didn't know.
 
@DanBron Are they cunning monolinguals at least?
 
In Dutch, kut can also be diminuated to kutje, which is even worse.
 
That's just one example. You can do it all in English as needed.
 
Or you could say kutje bef, which means "little cunt, lick".
 
@terdon There's a civil war among us...
 
4:04 PM
:)
 
00:00 - 15:0015:00 - 17:00

« first day (2084 days earlier)