Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
claProductVersion=`head -l ${amSqlCre}` claProductVersion=`expr "${claProductVersion}" : 'Create Table \([^ ]*\) ('`
1man expr会告诉你STRING : REGEXP,这意味着anchored pattern match of REGEXP in STRING
man expr
STRING : REGEXP
anchored pattern match of REGEXP in STRING
2 正则表达式\([^ ]*\)将匹配字符串,如xxx. [^ ]表示除空格以外的任何字符。并且*意味着重复任何时间,包括零。\(and\)表示显示匹配的字符串。没有它们,结果将是正则表达式匹配的位置。
\([^ ]*\)
xxx
[^ ]
*
\(
\)
3 我还是觉得有些不对劲。l在这里没有意义。它应该是一个1.
l
1