Can someone explain js regular expression? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone explain js regular expression?

Tried learning w3schools.com javascript regular expression and did not understand at all... Ill be happy if someone could ezplain it more.. https://www.w3schools.com/js/js_regexp.asp

26th Aug 2017, 11:04 AM
Elad Goldenberg
Elad Goldenberg - avatar
5 Answers
+ 2
regex will capture the input and match the regex expression to the input if it matches it makes it through validation ..... like .*@.* (for email validation) basically says search any character up to a @ and any characters after the @...so if it finds the @ this expression will trigger in an if statement for validation and go through but if no @ it won't
26th Aug 2017, 11:18 PM
Sam Tezel
Sam Tezel - avatar
+ 2
practice with some text to see what it can do in regexr.com
26th Aug 2017, 11:19 PM
Sam Tezel
Sam Tezel - avatar
+ 2
regex is often used with php curl to get only the info you want to show or use from the curl
26th Aug 2017, 11:22 PM
Sam Tezel
Sam Tezel - avatar
+ 1
regular expression allows you to capture or replace specific string or character content
26th Aug 2017, 11:10 PM
Sam Tezel
Sam Tezel - avatar
0
I have seen regular expressions that are used to validate forms age/email etc.. How does it work?
26th Aug 2017, 11:13 PM
Elad Goldenberg
Elad Goldenberg - avatar