默认情况下,get_ports(和其他get_ *命令)使用“glob”通配符。
在“glob”通配符中,*表示“任意数量的任何字符”和一个?
意思是“任何一个角色”(+也做了一些事,但我从不使用它)。
因此,你可以使用
get_ports A [?];
#为0-9位
get_ports A [1?];
#为10-19位
get_ports(以及其他get_ *命令)可以更改其行为以使用正则表达式而不是glob通配符。
为此,您必须在命令中添加-regexp选项。
然后你可以做muzaffer建议的,但你必须小心“真正的”方形支架。
get_ports -regexp“A [[0-9] ]”;
#对于0-9位
get_ports -regexp“A [1 [0-9] ]”;
#为10-19位
Avrum
在原帖中查看解决方案
以上来自于谷歌翻译
以下为原文
By default, the get_ports (and other get_* commands) use "glob" wildcarding. In "glob" wildcarding, a * means "any number of any characters" and a ? means "any one character" (The + does something as well, but I never use it).
Thus, you can use
get_ports A[?]; # for bits 0-9
get_ports A[1?]; # for bits 10-19
The get_ports (and other get_* commands) can change their behavior to use regular expressions instead of glob wildcarding. To do this, you have to add the -regexp option to the command. Then you can do what muzaffer suggested, but you have to be careful with the "real" square brakets.
get_ports -regexp "A[[0-9]]"; # For bits 0-9
get_ports -regexp "A[1[0-9]]"; # for bits 10-19
Avrum
View solution in original post
默认情况下,get_ports(和其他get_ *命令)使用“glob”通配符。
在“glob”通配符中,*表示“任意数量的任何字符”和一个?
意思是“任何一个角色”(+也做了一些事,但我从不使用它)。
因此,你可以使用
get_ports A [?];
#为0-9位
get_ports A [1?];
#为10-19位
get_ports(以及其他get_ *命令)可以更改其行为以使用正则表达式而不是glob通配符。
为此,您必须在命令中添加-regexp选项。
然后你可以做muzaffer建议的,但你必须小心“真正的”方形支架。
get_ports -regexp“A [[0-9] ]”;
#对于0-9位
get_ports -regexp“A [1 [0-9] ]”;
#为10-19位
Avrum
在原帖中查看解决方案
以上来自于谷歌翻译
以下为原文
By default, the get_ports (and other get_* commands) use "glob" wildcarding. In "glob" wildcarding, a * means "any number of any characters" and a ? means "any one character" (The + does something as well, but I never use it).
Thus, you can use
get_ports A[?]; # for bits 0-9
get_ports A[1?]; # for bits 10-19
The get_ports (and other get_* commands) can change their behavior to use regular expressions instead of glob wildcarding. To do this, you have to add the -regexp option to the command. Then you can do what muzaffer suggested, but you have to be careful with the "real" square brakets.
get_ports -regexp "A[[0-9]]"; # For bits 0-9
get_ports -regexp "A[1[0-9]]"; # for bits 10-19
Avrum
View solution in original post
举报