To remove all instances of citations like [cite: 3, 4] or [cite: 8] from your Google Docs text using Find and Replace with regular expressions, follow these steps:
🔍 Regex Pattern Explanation
The citations follow a consistent structure:
- Start with
[cite: (including the colon and space).
- Followed by one or more digits (
\d+).
- Optionally, more numbers separated by
, (comma and space), e.g., , 4.
- End with
].
The regex pattern to match this is:
$$cite: \d+(?:, \d+)*$$
Breakdown:
$$ and $$: Match the literal square brackets.
cite: : Matches the literal text "cite: " (colon and space are important).
\d+: Matches one or more digits (e.g., 8 or 3).
(?:, \d+)*: Matches zero or more occurrences of , followed by digits (e.g., , 4).
🛠️ Steps to Remove Citations
- Open Google Docs.
- Press Ctrl + H (or go to Edit > Find and replace).
- Check the box for "Use regular expressions".
- In the "Find" field, type:
$$cite: \d+(?:, \d+)*$$
- Leave the "Replace with" field empty (to delete the matches).
- Click "Replace all".
✅ Example
Before:
This is a sentence [cite: 3, 4]. Another example [cite: 8].
After:
This is a sentence . Another example .
⚠️ Notes
- This will only remove citations in the exact format shown (e.g.,
[cite: 3, 4] or [cite: 8]).
- If there are variations (e.g., missing space after colon or commas), the regex may not match them. Adjust the pattern accordingly if needed.
- Always test the regex on a copy of your document first to ensure it behaves as expected.
Let me know if you need to handle edge cases (e.g., missing spaces, extra characters)!