I have a regex as follows.
'#^(VK[1-8][0-9A-Z]+)#i'
This is fine and will return true if the string begins with VK[1-8][0-9A-Z], for example VK2TEST. But what if, following [0-9A-Z], there is the possibility of a / and more characters, some of which I need to return true and some of which I need to return false? For example VK2TEST/P.
If I need to return, let's say, VK2TEST/P and VK2TEST/M as true, but other alphanumeric characters proceeding the / as false, how do I go about this? Is this even possible? For example...
VK2TEST = true
VK2TEST/P = true
VK2TEST/P1 = false
VK2TEST/M = true
VK2TEST/MM = false
VK2TEST/QRP = true
My research points me to conditional subpatterns, but I don't really know if I'm heading in the right direction with this.