© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
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
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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Regex help.
C#CC# / help
11mo ago
✅ Learning Regex
C#CC# / help
3y ago
❔ Smart Regex
C#CC# / help
3y ago
❔ REGEX help!
C#CC# / help
3y ago