Dear all,
I have patient side effect descriptions which look like below. Most patients had their location of symptom ended in the last parentheses of the description (that's how the form generated the response). I would like to capture whatever are in the last parenthesis in the description i.e., "right eye" / "left eye" / "both eyes" / left side of my head etc. in the descriptions. Any help with -ustrregex- is much appreciated. Thanks.
I have patient side effect descriptions which look like below. Most patients had their location of symptom ended in the last parentheses of the description (that's how the form generated the response). I would like to capture whatever are in the last parenthesis in the description i.e., "right eye" / "left eye" / "both eyes" / left side of my head etc. in the descriptions. Any help with -ustrregex- is much appreciated. Thanks.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str92 symp "I had severe migraine from headache it's(continuous) and also had watery eye only(right eye)" "I had severe migraine from headache it's(continuous) and also had watery eye only(left eye)" "I had severe migraine from headache it's(continuous) and also had watery eye only(both eyes)" "I had severe migraine from headache it's(continuous) and (left side of my head)" "I had severe migraine from headache it's(continuous) and (lack of sleep)" "I had severe migraine from headache it's(continuous) and also had (drowsiness)" "I had severe migraine from headache it's(continuous) and also had watery eye only(right eye)" end

. Now for my understanding, I read your code as: "\(" = skip opening parenthesis, "(.*)" = get everything, "\)" = skip closing parenthesis, "$" = occuring at the end. I am not being able to figure out the role of ".*" at the begining and the "$1" at the end. Would you mind explaining these two parts if that is not too time consuming. Thank you again.
Comment