更具体一点:我想找到第一个和最后一个*
之间的所有内容:
\*\*KEMPE\*\* TM0001 hydraulic leak \*TECO\*Repair Slag Pot 59 \*\*TECO\*\*\* Scaffold removal Acid Plant At \*CAL A\*
即
\*\*KEMPE\*\*, \*TECO\*, \*\*TECO\*\*\*, \*CAL A\*
答案 0 :(得分:0)
grep
echo "**KEMPE** TM0001 hydraulic leak *TECO*Repair Slag Pot 59 **TECO*** Scaffold removal Acid Plant At *CAL A*" |
grep -oE '\*+[^*]+\*+' | xargs
**KEMPE** *TECO* **TECO*** *CAL A*