[Solved] What’s the proper syntax in preg_match for validating a string if it contains a alphanumeric value w/ special characters [closed]
[ad_1] If you want to test if a string contains at least one alphanumeric and at least one non-alphanumeric string, use the following regex: /^(?=.*[a-z0-9])(?=.*[^a-z0-9])/i Breakup: / start of regex ^ match the start of the string (?= if the following is present there: .* anything at all (except newlines), then [a-z0-9] an alphanumeric character … Read more