I'm having problem with extracting data using regex, usually i can do it easily but i find myself stuck here. I'm trying to extract the part that comes after "n" and before "end"
the data I can have is
jack. n n klln kjj kll end
jane. n n kien wsdn end
jone. n losn djs end
jord. n sdjn sdkln end
Now "n" can occur one or two times only.
I've used this to extract $3
\(.+?\.) .*n.* (n|\s) (.*) end\
It works for every instance, but it doesn't work for line 3. What it does is it also includes "losn". In all cases, two "n" or one "n" can occur. if one "n" is present, "n" can either be a space away from the data that I want. Or many spaces away.