ツイートからすべてのユーザー名を削除する正規表現があります。次のようになります。
regexFinder = "(?:\\s|\\A)[@]+([A-Za-z0-9-_]+):";
各コンポーネントの機能を理解しようとしています。これまでのところ、私は持っています:
( Used to begin a “group” element
?: Starts non-capturing group (this means one that will be removed from the final result)
\\s Matches against shorthand characters
| or
\\A Matches at the start of the string and matches a position as opposed to a character
[@] Matches against this symbol (which is used for Twitter usernames)
+ Match the previous followed by
([A-Za-z0-9- ] Match against any capital or small characters and numbers or hyphens
私は最後のビットで少し迷っています。+): の意味を教えてください。ブラケットがグループを終了していると仮定していますが、コロンまたはプラス記号は得られません。
正規表現の理解に誤りがあった場合は、遠慮なく指摘してください。