I'd love to have a regex with that will allow the following:
A text for which every line has a maximal length, lets say 10, and the total text had a maximum number of total characters (lets say 30).
For example this would be some valid inputs:
1)
1234567890
2)
123456789
1234567890
3)
12
123456
12456
And this would be some invalid inputs:
1)
12345678901
2)
1234567890
1234567890
1234567890
(note that invalid example 2 exceeds the 30 characters limit due to the newlines)
What I have so far is this Regex: ^([^\r\n]{0,10}(\r?\n|$)){5}$
(Test it here)
It almost meets my requirements, except that the maximum input is 5 lines instead of 30 characters. I already put a lot of effort in this regex but now I'm stuck.
What modifications does my Regex need to match 30 characters in total?