mar*_*rya 1 regex notepad++ openoffice-calc
I would like to remove all the characters before the first space occurrence for each line.
Sample of initial text:
Result must be:
What regular expression would you use to achieve this result using OpenOffice Calc or Notepad++?
^\S+\s+(.+)$$1. matches newline说明:
^ : beginning of line
\S+ : 1 or more non space character
\s+ : 1 or more space character
(.+) : group 1, 1 or more any character (ie. rest of the line)
$ : end of line
Run Code Online (Sandbox Code Playgroud)
替代:
$1 : content of group 1
Run Code Online (Sandbox Code Playgroud)
给定示例的结果:
My dog is good.
My cat is bad
My frog is bad but it loves my garden.
Run Code Online (Sandbox Code Playgroud)
^.*?\s+(.*)$在“查找内容”文本框中写入$1在“替换为”文本框中写入Regular Expression单选按钮或按ALT+g解释:
^ : 从行首匹配.*?\s+: 匹配任意次数,直到遇到一个空格(或更多空格)(.*):捕获这些空格后的所有内容$: 匹配到行尾$1: 从 line 访问上面捕获的字符串| 归档时间: |
|
| 查看次数: |
4519 次 |
| 最近记录: |