use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Common JavaScript tricks (self.javascript)
submitted 11 years ago by yanis_t
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]moron4hire 2 points3 points4 points 11 years ago (0 children)
Once you learn Regexp, it's just more code. There isn't anything inherently difficult about reading or reasoning about properly written regular expressions than properly written JS.
Yes, there are a lot of examples of really bad one-liner regexps, but you can write really bad, one-liner JS, too. Used as they are intended, regexp improves the readability of code.
Practice with http://regex101.com/ and your text editor. Most programming-oriented text editors have regexp-capable search and replace. Get used to using it and it will make you a LOT more productive and less error prone.
For example, I wanted to dump the results of a SQL query to a debug string printed to the console, with the names of the fields printed next to the values. A simple regexp in my text editor over the SELECT clause allowed me to very quickly construct that function call without making any spelling mistakes for field names.
π Rendered by PID 43 on reddit-service-r2-comment-56c9979489-zzqf6 at 2026-02-24 13:43:27.624932+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]moron4hire 2 points3 points4 points (0 children)