Regular Expressions 101

Community Patterns

ternary operator in C++

1

Regular Expression
PCRE (PHP <7.3)

/
(?P<conditional>(?:(?:(?:"(?:(?:\\")|[^"\n])*")|(?:'(?:(?:\\')|[^'\n])*'))|(?:==|>=|<=)?[^=\?\n\(\)]|\((?1)\))*)\?(?P<true>[^{}\n:]*)\:(?P<else>[^{}\n:]*)(?:;|\))
/
gmi

Description

match ternary operator in C++

Submitted by Денис Суховерхов - 8 years ago