C
C#12mo ago
mrdudebro1

Regex conditional

Hi all,
(?(?=.[P]*)((ADIP)(\d{0,3})[P]\d{3}\.(\d{1,2}))|((ADIP)(\d{0,10})\.(\d{1,2})))
(?(?=.[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
1 Reply
mrdudebro1
mrdudebro1OP12mo ago
oh schweet that works what does that ? denote oh ok yeah once or none is what i'm looking for thanks!
Want results from more Discord servers?
Add your server