Detect double-digit numbers in string

132 views
Skip to first unread message

Howard

unread,
May 13, 2022, 12:41:45 PM5/13/22
to BBEdit Talk
Using GREP, how can I detect those strings that contain double-digit numbers?

Sample input

CG(10), W

CG(11), W

CG(6), W

CG(17), L

SHO(5), W

I have a column with text values such as those shown above. I need to identify those rows that contain a double-digit value between the parentheses (the numbers will always be within parentheses) and then extract for each just the number and the letter that follows the comma.

Sample output

10 W

11 W

17  L

Kaveh

unread,
May 13, 2022, 1:58:40 PM5/13/22
to bbe...@googlegroups.com
Search: (.+?)\((\d\d)\), ([A-Z])
Replace: \2 \3

Press "Extract"

Screenshot 2022-05-13 at 18.55.59.png


--
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/f27bd294-261c-42a7-a1a5-a9b2951afef6n%40googlegroups.com.


--
Kaveh Bazargan PhD
Director
Accelerating the Communication of Research

Kaveh

unread,
May 15, 2022, 6:48:40 AM5/15/22
to bbe...@googlegroups.com
did it work?

Howard

unread,
May 31, 2022, 9:57:14 AM5/31/22
to BBEdit Talk
Yes, it worked. Thank you for your help.

Kaveh

unread,
May 31, 2022, 10:00:01 AM5/31/22
to bbe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages