需要在 Notepad++ 中使用 REGEX 的方向来查找还包含空格的行中的字符长度
Needing direction using REGEX in Notepad++ to find length of characters in line that also contains spaces
我有一个 TEXT 文件,其中包含 4700 行 30 个字符的值。数字字符位于 1 到 8 的位置,之后应该只有空格。我在 NOTEPAD++ 中使用 REGEX 来查找 2 个不同的场景:
- 我想知道在我的文本文件的任何一行中是否存在位置 1-8 中小于 6 的字符长度。
- 我的文本文件中是否有任何长度 > 30 的行。我想我找到了这个问题的答案,但需要一些确认,因为我
我没有在我的结果中找到任何东西。这是我在 NOTEPAD++ 中使用的内容,找到这些值:.{30, }
任何help/direction将不胜感激。谢谢
这是我的文件的示例:
332268-1
322335
322375
322393
322368-1
322381
322475
323912-1
322539
322641
322641
322514-1
322638
322978
322978
322638-1
287686
287735
322579
322643
323113
323257
331875
331875
322637-1
322720-1
322745-1
322679
322702
322971
324548
322971
333146-1
1 号将是 ^\d{0,5}\s+\n
^ matches the beginning of the string or line
\d digit
{0,5} matches quantify or proceeding token
\s whitespace
+ quantifier matches 1 or more
\n is a new line
2 号将是 ^.{31,}
^ matches the beginning of the string or line
. matches any character but line breaks
{31,} matches any line that is 31 characters or greater.
我有一个 TEXT 文件,其中包含 4700 行 30 个字符的值。数字字符位于 1 到 8 的位置,之后应该只有空格。我在 NOTEPAD++ 中使用 REGEX 来查找 2 个不同的场景:
- 我想知道在我的文本文件的任何一行中是否存在位置 1-8 中小于 6 的字符长度。
- 我的文本文件中是否有任何长度 > 30 的行。我想我找到了这个问题的答案,但需要一些确认,因为我 我没有在我的结果中找到任何东西。这是我在 NOTEPAD++ 中使用的内容,找到这些值:.{30, }
任何help/direction将不胜感激。谢谢
这是我的文件的示例:
332268-1
322335
322375
322393
322368-1
322381
322475
323912-1
322539
322641
322641
322514-1
322638
322978
322978
322638-1
287686
287735
322579
322643
323113
323257
331875
331875
322637-1
322720-1
322745-1
322679
322702
322971
324548
322971
333146-1
1 号将是 ^\d{0,5}\s+\n
^ matches the beginning of the string or line
\d digit
{0,5} matches quantify or proceeding token
\s whitespace
+ quantifier matches 1 or more
\n is a new line
2 号将是 ^.{31,}
^ matches the beginning of the string or line
. matches any character but line breaks
{31,} matches any line that is 31 characters or greater.