It looks like the new version of OS X no longer supports grep -P
and as such has made some of my scripts stop working, for example:
var1=`grep -o -P '(?<=<st:italic>).*(?=</italic>)' file.txt`
I need to capture grep's result to a variable and I need to use zero-width assertions, as well as \K
:
var2=`grep -P -o '(property:)\K.*\d+(?=end)' file.txt`
Any alternatives would be greatly appreciated.