I have a textfile with a number of lines, and I would like that each line that matches the pattern is saved to another textfile (up to maxnumberofmatches lines).
Is this possible at all (or can pattern only contain word characters and not meta characters?), or would a totally different way to get closer to this problem be better?