I have a string consisting of N- length of special character delimiters, Input: --1-----3--1-2
where once the .split method applied on the pattern should give output as below.
I wish to make a pattern where if the length of delimiter,N is N>1, to get the resulting match as, Output: 1,3,1,-2
Note the last element.
So far I have implemented the use of look ahead operator: (\\W)(?=[\\-{2,}\\d])
giving 1,3,1,2
.
Any feedback is appreciated. Many thanks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.