XML屬性從這個XML字符串從我3210文件中提取的版本號我需要提取的版本號的前三位:如何從使用bash
<widget id="com.test.enterprise.test" version="3.0.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
我已經試過:
cat config.xml | grep "<widget" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'
但這隻產生.
如何正確的正則表達式看起來像?