JavaScript Odd str.split behaviour, str.match works fine
By
Alef
in Programming
in Programming
Go to solution
Solved by Mira Yurizaki,
The parenthesis in your regular expression is creating separate capture groups that split is using. If you get rid of them then it appears to work as intended.
[0-9]{5}\s+-+\s+[A-Z]{3,4}\s+[0-9]{4}U/g
I was using https://regex101.com/ to verify this.
-
Topics
-
_Darasuum_ ·
Posted in Power Supplies0 -
0
-
1
-
anothertealtiger ·
Posted in Programs, Apps and Websites2 -
Mumintroll ·
Posted in Programs, Apps and Websites4 -
ElDTac ·
Posted in CPUs, Motherboards, and Memory3 -
HunterSVK ·
Posted in Troubleshooting2 -
Ozzi ·
Posted in Networking5 -
2
-
MadManMarsBar ·
Posted in Build Logs3
-
-
play_circle_filled
Latest From ShortCircuit:
The coolest looking monitor. Period. - ASUS ROG display at Computex (Sponsored)

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now