<!-- Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting Forum for questions: https://users.rust-lang.org/c/ide/14 Before submitting, please make sure that you're not running into one of these known issues: 1. on-the-fly diagnostics are mostly unimplemented (`cargo check` diagnostics will be shown when saving a file): #3107 Otherwise please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3. --> **rust-analyzer version**: 0.3.1877-standalone (574e23ec5 2024-03-09) **rustc version**: 1.75.0 (82e1608df 2023-12-21) **relevant settings**: N/A **repository link (if public, optional)**: N/A **code snippet to reproduce**: ```rust Regex::new("[^/]") ``` Place your cursor after the `/` and insert a `*`. It will expand to: ```rust Regex::new("[^/* */]") ``` I don't think it should insert a comment since it's inside of a string. Some more examples: * These trigger the issue: * `Regex::new("/ ")` * `Regex::new("/]")` * These do not: * `Regex::new("/")` * `Regex::new(" /")` * `Regex::new("[/")`