Folks,

I need help to reset my brain, w.r.t. an apparently-straightforward regex.
I am sure I am missing something obvious here.

I keep thinking that the regex below ought to get me all the words on a line
except the backslash.  Instead I am only getting the final word.

(In my code, I threw out the regex, and resorted to split().  But my mental
blind spot on this regex is bothering me.)

> % cat > input.txt
> a b c \
> d e
> %
> % perl -lne 'print for m{ ^ (?: \s* (\w\S*) )+ \s* \\? $ }xg' !$
> c
> e
> %

peace,          || Just the facts, ma'am:
--{kr.pA}       || http://www.washingtonpost.com/blogs/fact-checker/
-- 
Yoga: origami for people.

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to