Check out a free preview of the full Introduction to Bash, VIM & Regex course
The "Regular Expressions in JavaScript" Lesson is part of the full, Introduction to Bash, VIM & Regex course featured in this preview video. Here's what you'd learn in this lesson:
James demonstrates how to use Regular Expressions in JavaScript.
Transcript from the "Regular Expressions in JavaScript" Lesson
[00:00:00]
>> James Halliday: To do the same thing in JavaScript you can use that row place. If you have node installed you can type node and then you can sort of do dot replace and replace the one with the word one, or maybe we wanna replace any number with the word, number.
[00:00:26]
That also works, so that can be a different number, like 1000. Some examples for what these mean, I'm gonna go a little bit more into that in just a moment, so
>> James Halliday: Why don't we just well.
>> James Halliday: Yes, so, why don't I just show few more of these and then we can experiment on the command line just.
[00:00:59]
Trying some things with Node, hopefully you will have that installed. Also trying some things with sed, and just piping output from the echo command into sed. So here's a little program, for example, that will match on the first argument that's given, which is process.argv(2). So, this will match dash H and dash dash help is what that means.
[00:01:25]
Print a message and that's just an example as well of some other things you might wanna see.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops