^[^a-z0-9]*(.).*$

^ at beginning of line
[^a-z0-9] look for anything which isn’t a-z 0-9
* 0 or more times
(.) any single character (i.e. a-z 0-9), and ‘capture’ it for replacement 
pattern
★ any characters
$ end of line

Replace with

\1

Cheers


> On 2022-01-17, at 12:16, Howard <[email protected]> wrote:
> 
> Using the input data below and using Grep, I need either the first digit  or 
> letter extracted from each row (just one per row), so the output looks like 
> what is shown below. Though the output is displayed here in horizontal 
> format, I need the actual output in vertical format without any commas.
> Howard
> 
> Output
> 9, 3, D, 6, 8, 5, 3, 9, 5, 2, 7, 4, 3, D, 8, 7
> 
> Input data:
> *9/HD
> *3D/5
> *D1/H97
> *69/8HD
> *87/HD
> 57983/H
> *3
> *97D/8H
> *5D/H
> *2/D3H
> *7H/8
> *4/H
> *3/D5
> *D7/9
> *84/H
> 7DH/9
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit <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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/5bc28303-df27-47a4-a6ca-a0e0d20e6a43n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/bbedit/5bc28303-df27-47a4-a6ca-a0e0d20e6a43n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/8A1B4EFE-21E9-48C4-91B8-07660F48BBE8%40gmail.com.

Reply via email to