Could someone give me an example on using a wildcard with strpos and regexr ? For example, I want to scan a string variable (with multiple words) called meds for nu seal, nu-seal and nuseal, (or variants thereon) and replace with aspirin, . eg.
replace meds=regexr(meds,"nu[ -]seal", "aspirin") works for nu-seal and nu seal, but doesn't include "nuseal". I know I could write another line, but there are instances where I'd like to incorporate a wildcard into the one regex command. Same holds for strpos. Any pointers would be very much appreciated!
replace meds=regexr(meds,"nu[ -]seal", "aspirin") works for nu-seal and nu seal, but doesn't include "nuseal". I know I could write another line, but there are instances where I'd like to incorporate a wildcard into the one regex command. Same holds for strpos. Any pointers would be very much appreciated!
Comment