I have a string that looks like this:
"12345678ABCDEFGHIJKLMN2018/05/202018/05/30ABCD"
I want to split it based on n-sized lengths: 8 chars, 14 chars, 10 chars, 10 chars, 4 chars
So it would look like this:
12345678 (8 chars)
ABCDEFGHIJKLMN (14 chars)
2018/05/20 (10 chars)
2018/05/30 (10 chars)
ABCD (4 chars)
I know I could do this way: /(.{8})/ then split the string and continue /(.{14})/ and so on... But I was wondering if it is possible with on RegExp?
RegExp, why not just usesubstrsince you already start/ed positions of each substring^(........)(..............)(..........)(..........)(....)$