Regex pattern to remove special character

no… if the wq contains any special char… it should not take that special charactrs.

it should fetch only wq or q followed by 7 or 8 digits