我想为Screen开发一个选择工具,忽略选择中的前导空格和数字.
问题
C-a Esc屏幕中选择工具的代码?alt text http://files.getdropbox.com/u/175564/%20selection-less.png
以下Perl-regex似乎与该行的开头相匹配
{5}[1-9]{1-4} {8} # not tested
Run Code Online (Sandbox Code Playgroud)
选择工具显然通过将选择的增加连接到当前选择来工作.例如,选择一行.我选择另一个:在选择队列中添加一个新行.反之亦然,选择减少.
我想在选择过程中使用Perl正则表达式,\n以便考虑线的无知.
我想你想要选择列.这比正则表达容易得多.
从屏幕联机帮助页:
Run Code Online (Sandbox Code Playgroud)c or C to set the left or right margin respectively. If no repeat count is given, both default to the current cursor position. Example: Try this on a rather full text screen: "C-a [ M 20 l SPACE c 10 l 5 j C SPACE". This moves one to the middle line of the screen, moves in 20 columns left, marks the beginning of the paste buffer, sets the left column, moves 5 columns down, sets the right column, and then marks the end of the paste buffer. Now try: "C-a [ M 20 l SPACE 10 l 5 j SPACE" and notice the difference in the amount of text copied.
因此,在屏幕截图中,按C-a [,将光标移动到文本的开头,按SPACE,然后按c.移至所选内容的末尾,然后再按SPACE一次.现在你有了你想要的文字.
希望这不是太多的信息.你用初学者标记它,所以我不确定你是perl还是屏幕初学者.