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
-
TukangKopi ·
Posted in Networking0 -
0
-
8
-
9
-
Cramig88 ·
Posted in Networking0 -
5
-
dominz88 ·
Posted in Peripherals1 -
3llyas ·
Posted in Graphics Cards1 -
jsnotlout1 ·
Posted in Graphics Cards11 -
1
-
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