<caption align="Top">
Class Timetable was last refreshed on 04/05/2015 11:18AM
</caption><tr class="OptionRow">
我只想提取日期和时间值。04/05/2015 11:18 AM
我曾经使用过grep,sed,cat |猫,但他们没有工作。谢谢
$ grep -Eo '([[:digit:]]{2}/){2}[[:digit:]]{4} [[:digit:]]{2}:[[:digit:]]{2}[AP]M' file
04/05/2015 11:18AM
或:
$ sed -nr 's|.*(([[:digit:]]{2}/){2}[[:digit:]]{4} [[:digit:]]{2}:[[:digit:]]{2}[AP]M).*|1|p' file
04/05/2015 11:18AM