Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142410

Search number of characters in Javascript using regexp [duplicate]

$
0
0

How do you find the first 4 characters/letters in this string using regexp? In this case , how to find SPAS?

var str = "SPASIAL1-40";

i'm confused whether to use /\w/g or /\d{4}/g


Viewing all articles
Browse latest Browse all 142410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>