Faced with the problem of parsing version of clang for different vendors clang --version|head -1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) => 3.5
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 => 3.4.1
clang version 3.5.0 (tags/RELEASE_350/rc2) => 3.5.0
Now have this regular expression
match: (clang version|based on LLVM)\ (\d+)(\.\d+)(\.\d+)?
to \2\3\4
I need to exclude (clang version|based on LLVM)
from the result match() - \1
.