let word= re"[a-z]w*" let num= re"d*"
let wordNum= re"[a-z]w*$num"
Please guide to the correct simple one
Something along the lines of:
let
wordPattern = r"[a-z]\w*"
numPattern = r"\d*"
word = re(wordPattern)
num = re(numPattern)
wordNum= re(r"[a-z]\w*" & numPattern)
This is because the re function returns an already compiled regex, so you can't really insert more things into it. So you need to keep the patterns strings and the compiled regexes separate. Note that the r prefix is required for the strings, this means they are raw string literals so that e.g. \n won't be read as a newline.