string-regex-get-variable

Published at 2024-01-16
Last update over 365 days ago Licensed under CC BY-NC-SA 4.0 softwares-and-toolsfishstring
    git remote -v | string match -rq 'github\.com:(?<remote>[\S]+)\.git'

(?...) 其中 ... 是要变量的 regex,而匹配的结果会存储到 $name 这个变量中。