I want to use re.search to extract the first set of non-whitespace characters. I have the following pseudoscript that recreates my problem:
#!/usr/b
import re
line = "STARC-1.1.1.5 ConsCase WARNING Warning"
m = re.search('S.+[0-9]',line)
print(m.group(0))
The re.search returns the match, so use the alphabets and numbers and print the match as mentioned in the code. If you print only the variable it prints it as match 1. Hope this answers your question
m = re.search('[A-Z].+[0-9]',line)
Changing the re.search to the capital letters will find from CAPS A to Z, vice vers if you change it to small letters as
m = re.search('[a-z].+[0-9]',line)
it will find only small letters, sometimes you should highlight the symbols too, to search from it or to search upto the characters before that symbol.