Regex conditional

Hi all,

(?(?=.[P]*)((ADIP)(\d{0,3})[P]\d{3}\.(\d{1,2}))|((ADIP)(\d{0,10})\.(\d{1,2})))

I'm trying to use a conditional to find if there is a P in my string but for some reason the else condition of this doesn't get picked up on. For example,

This matches: ADIPP350.16

but this doesn't (and should): ADIP350.16

i can only presume there is some confusion with the P in the ADIP literal match
Was this page helpful?