Extract text from a string

前端 未结 4 953
孤街浪徒
孤街浪徒 2020-12-05 04:30

How do I extract the \"program name\" from a string. The string will look like this :

% O0033(SUB RAD MSD 50R III) G91G1X-6.4Z-2.F500 G3I6.4Z-8. G

4条回答
  •  失恋的感觉
    2020-12-05 05:09

    If program name is always the first thing in (), and doesn't contain other )s than the one at end, then $yourstring -match "[(][^)]+[)]" does the matching, result will be in $Matches[0]

提交回复
热议问题