'PHP Regex match one letter and one number
I'm trying to replace any occurrences when you find a single letter followed by a single number in a string.
$word = 'AB001J1'; //or ZR010F2 or ZQ10B5
echo str_replace('/^(?=.*\pL)(?=.*\p{Nd})/', '', $word);
Trying to get the result AB001 //or ZR010 or ZQ10
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
