Sou my question is about regular expression in Javascript.... Owk I need syntax to match character a-zA-Z | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Sou my question is about regular expression in Javascript.... Owk I need syntax to match character a-zA-Z

8th Feb 2017, 5:03 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar
5 Answers
+ 2
im not the js pro but this should work ;) var s = "Please yes make my day!"; s.match(/[a-zA-Z]+/);
8th Feb 2017, 6:02 PM
R4xx4r
R4xx4r - avatar
+ 1
[a-zA-Z]+ This should match any 1 or more alphabet characters. Here's a cheatsheet: https://www.debuggex.com/cheatsheet/regex/javascript
8th Feb 2017, 5:58 PM
ChaoticDawg
ChaoticDawg - avatar
0
So do I need to write it this way /[a-zA-Z]+ /
8th Feb 2017, 6:03 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar
0
@r4 why didn't you use test() instead of match
8th Feb 2017, 6:08 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar
0
@r4 why didn't you use test() instead of match
8th Feb 2017, 6:08 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar