Take the 2-minute tour ×  I know regular expressions can be
used, but am not able to find the right one. Also are there any
built-in functions available that do this?  share|improve this
question Could you explain a little more clearly what you want?
Exactly what do you want to match and extract? Can you give some
example input strings that you want to match & not match, and
what output you're after? –  mathematical.coffee Feb 28 '12 at
6:30 Not without some extra restrictions, they can't. Modern
*nix paths can contain any character except \0. Meaning, you can
have a path that looks like a sentence if you want. The only
thing you can really go by, for absolute pathnames, is a leading
slash. –  cHao Feb 28 '12 at 6:30 "bmake: stopped in
/bb/cc/xx/yy/zz/aa". from this I just want to extract
/bb/cc/xx/yy/zz/aa –  karthik A Feb 28 '12 at 6:35 In this case
I'd suggest matching bmake: stopped in instead, and then
whatever follows it. Like /stopped in (.*)/. –  raina77ow Feb 28
'12 at 6:52 add comment  3 Answers  up