我下面有文字,我想从中获得某些内容。
Checkbox[Skip Transfer]: Skip the transfer process if checked.
Dropdown[OS Types]: A dropdown to select the target OS. Transfer protocol,
connection protocol and destination path will be adjusted
based on this option.
* Destination path may be changed manually. If it was
changed this option has no effect on destination.
Dropdown[CPU Types]: A dropdown to select the executable. Target file will be
adjusted based on this option.
* Source file may be changed manually. If it was
changed this option has no effect.
Dropdown[Copy Actions]: A dropdown to select the action that will be applied on the
destination file.
这是我的帮助信息,我想将相关部分传递给相关项目。
Checkbox[Skip Transfer]: Skip the transfer process if checked.
对于此行,“复选框”是我的类型,“跳过转移”是我的文字,如果选中,则跳过转移过程。是我对相关项目的帮助信息。
我尝试了以下正则表达式(在Python中): (?P<kind>\w+)\[(?P<name>[\w ]+)\].*:\s+(?P<help_msg>[\w\W]*)(?!(\w+\[))
该种类和名称成功解析,但我无法得到正确的帮助信息。
试试这个:
(?P<kind>\w+)\[(?P<name>[\w ]+)\].*:\s+(?P<help_msg>(?:[^\n]|\n(?!\w+\[))*)
作为帮助消息,我得到了
\w+\[
参见演示。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句