9 ms·
what are the / for? I couldn't figure out how to get started until I read someone in the comments suggest to make them optional.
by wodenokoto 4y ago
what are the / for?
I couldn't figure out how to get started until I read someone in the comments suggest to make them optional.
- deleted 4y ago[deleted]
- WorldMaker 4y agoIt's a traditional Regex syntax in several languages including JS (relevant here), Perl, and going way back to ancient Unix tools such as vi and ed. The vi/ed form you often see in HN and other technical discussion memes too, such as: s/easy/hard Which is a joke to substitute uses of the word "easy" with "hard". The slashes mark a RegEx so you can get really clever in such jokes, though usually most such jokes are simple word substitutions.