Reputation: 123
I have a java regex to get a (numeric space text) value but when i have a new line the value doesn´t grouped, sample
regex expression (\d{14}\s.*\n)
Value :
59105999000321 My value start
with new line number
12105999000343 AAAAAasasas asdasdasd
32105999000323 asdasxasxasx asdasd
the group result in https://regex101.com/ is:
Match 1
Full match 0-29 `59105999000321 My value start`
Group 1. 0-29 `59105999000321 My value start`
Match 2
Full match 51-87 `12105999000343 AAAAAasasas asdasdasd`
Group 1. 51-87 `12105999000343 AAAAAasasas asdasdasd`
Match 3
Full match 88-122 `32105999000323 asdasxasxasx asdasd`
Group 1. 88-122 `32105999000323 asdasxasxasx asdasd`
I have a regex with following result:
group 1 : 59105999000321 My value start
with new line number
group 2: 12105999000343 AAAAAasasas asdasdasd
group 3: 32105999000323 asdasxasxasx asdasd
I expect
group 1 : 59105999000321 My value start with new line number
group 2: 12105999000343 AAAAAasasas asdasdasd
group 3: 32105999000323 asdasxasxasx asdasd
how i do this in java?
Upvotes: 0
Views: 55