How to create substrings from input string using regex? -
how create substrings input string using regex?
each substring should have 3 contigious characters in input.
ex:
input text="1234abc";
expected substring
output :123,234,34a,4ab.abc....
use lookahead
(?=(.{3}))
so,first 3 characters captured in group within lookahead..now move next character (i.e 2 in example) , again capture 3 characters , on..
note:
group captures within lookaround support limited regex implementations
Comments
Post a Comment