Regex 记事本++;。删除大括号中的所有空格[]

Regex 记事本++;。删除大括号中的所有空格[],regex,replace,notepad++,Regex,Replace,Notepad++,如何使用记事本++和正则表达式将所有空格移到大括号中 例如: 我有字符串[Word1 Word2 Word3] 我需要:[Word1Word2Word3] 谢谢 全部空格还是全部空白? \s++ matches any whitespace character (equal to [\r\n\t\f\v ]) ++ Quantifier — Matches between one and unlimited times, as many times as possible, without g

如何使用记事本++和正则表达式将所有空格移到大括号中

例如:

我有字符串[Word1 Word2 Word3] 我需要:[Word1Word2Word3]

谢谢


全部空格还是全部空白?
\s++
matches any whitespace character (equal to [\r\n\t\f\v ])
++ Quantifier — Matches between one and unlimited times, as many times as possible, without giving back (possessive)
Positive Lookahead (?=[^[]*])
Assert that the Regex below matches
Match a single character not present in the list below [^[]*
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
[ matches the character [ literally (case sensitive)
] matches the character ] literally (case sensitive)
Non-capturing group (?:\[|\G(?!^))
1st Alternative \[
\[ matches the character [ literally (case sensitive)
2nd Alternative \G(?!^)
\G asserts position at the end of the previous match or the start of the string for the first match
Negative Lookahead (?!^)
Assert that the Regex below does not match
^ asserts position at start of the string
Match a single character not present in the list below [^]\s]*
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
] matches the character ] literally (case sensitive)
\s matches any whitespace character (equal to [\r\n\t\f\v ])
\K resets the starting point of the reported match. Any previously consumed characters are no longer included in the final match
\s+
matches any whitespace character (equal to [\r\n\t\f\v ])
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)