I have a string that can be up to 240 characters long and can contain many dashes and in any position. I want to find and extract the string that matches the pattern of “?-####-?” or “?-###-?”
For example, in the data below I want to extract C-8539-C from the the 1st line and F-818-A in the 2nd line, etc.
C-8539-C 7.50 TO 9.00 J784-780
TO COVER RELEASE OF 5000, F-818-A CAGE
CARBURIZE AND HARDEN C-8471-A JOB# 270420
47294-OR-CORR#3085 HARDEN C-8571-A JOB# 270424
CARBURIZE C-8663-C JOB# 267644
HEAT TREAT F-5621-A JOB# 275025
SURCHARGE FOR C-8658-C
Can someone help me?
Thanks,
Wes
For example, in the data below I want to extract C-8539-C from the the 1st line and F-818-A in the 2nd line, etc.
C-8539-C 7.50 TO 9.00 J784-780
TO COVER RELEASE OF 5000, F-818-A CAGE
CARBURIZE AND HARDEN C-8471-A JOB# 270420
47294-OR-CORR#3085 HARDEN C-8571-A JOB# 270424
CARBURIZE C-8663-C JOB# 267644
HEAT TREAT F-5621-A JOB# 275025
SURCHARGE FOR C-8658-C
Can someone help me?
Thanks,
Wes