Help with Grep syntax

36 views
Skip to first unread message

mrcmrc

unread,
Sep 1, 2023, 2:43:02 AM9/1/23
to BBEdit Talk
Hi all, I would need help writing a Grep syntax to remove all square brackets and the numbers in them from a text. Basically, I have texts to which I would like to remove the numerical references in the notes. The numbers can be units, tens or hundreds.

Example:

Other conventions introduced by Doyle include the arch-criminal who is too clever for the official police to defeat, like Holmes's adversary Professor Moriarty, and the use of forensic science to solve cases.[1]

The Sherlock Holmes stories established crime fiction as a respectable genre popular with readers of all backgrounds, and Doyle's success inspired many contemporary detective stories.[174] Holmes influenced the creation of other "eccentric gentleman detective" characters, like Agatha Christie's fictional detective Hercule Poirot, introduced in 1920.[175]

Thanks!
- Marco.

Kaveh Bazargan

unread,
Sep 1, 2023, 2:51:18 AM9/1/23
to bbe...@googlegroups.com
Doea this work?

Search for 
"\[([0-9]+)\]"
Replace with
""

See here.

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/474ff991-eb45-4ee6-b1b7-9d21e3a538f3n%40googlegroups.com.


--
Kaveh Bazargan PhD
Director
Accelerating the Communication of Research
  https://rivervalley.io/gigabyte-wins-the-alpsp-scholarly-publishing-innovation-award-using-river-valleys-publishing-technology/

mrcmrc

unread,
Sep 1, 2023, 6:23:23 AM9/1/23
to BBEdit Talk
Perfectly, thanks Kaveh!

- Marco.

Reply all
Reply to author
Forward
0 new messages