Re[rough cuts]: regexp

A

Anurag Priyam

* Regexp ^ and $ work match more than just start and end of string. For
example, /^abc$/ does not match only "abc" but also "rm -rf /*\nabc"

Are you aware of the \A, and \Z regexp matchers - matches the start
and end of a string while ^, and $ match before and after newline.
 
B

Brian Candler

Anurag Priyam wrote in post #975100:
Are you aware of the \A, and \Z regexp matchers - matches the start
and end of a string while ^, and $ match before and after newline.

Actually, the correct answer is \A and \z if you want to match start and
end of string.

Yes, the facility exists. But people may be tripped up by this, which is
why I mention it.

Also, ruby // is like perl //m.
ruby //m is like perl //s.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top