/\Q|123456|john+\E/ # As long as the text doesn't # contain "$", "@", the regexp # delimiter (which is "/" here) # or \E.