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.
-
Featured Topics
-
Topics
-
Skelitor ·
Posted in General Discussion4 -
0
-
4
-
0
-
7
-
3
-
Sir Judgementz ·
Posted in General Discussion0 -
Rmooney193 ·
Posted in Troubleshooting1 -
2
-
8
-
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