Hello,
In the code below, I receive the error listed in the title of my question. I'm trying to extract the substring between asterisks: 'Some text: **string1;string2;string3**'. If I change the print statement to print(result.group(1)), I get the correct results (string1;string2;string3), but when I assign it to the variable result as I have in the code and print result, I get the error message. How do I use .group() correctly during the result variable assignment?
In the code below, I receive the error listed in the title of my question. I'm trying to extract the substring between asterisks: 'Some text: **string1;string2;string3**'. If I change the print statement to print(result.group(1)), I get the correct results (string1;string2;string3), but when I assign it to the variable result as I have in the code and print result, I get the error message. How do I use .group() correctly during the result variable assignment?
last_validation_comment_lst = validation_comment_lst[-1] last_validation_comment_string = ''.join(last_validation_comment_lst) result = re.search('\*\*(.*)\*\*', last_validation_comment_string).group(1) print(result)