Given two regexs expr1
and expr1
, can we write a lookbehind (?<=expr1)expr2
equivalently in terms of the if-then-else construct?
For example, is the lookbehind (?<=expr1)expr2
equivalent to (expr1)(?(-1)expr2|expr3)
, where expr3
is some regex which is never possible to match?
In other words, are the two regex's (?<=expr1)expr2
and(expr1)(?(-1)expr2|expr3)
describe the same?
If yes, how do you choose expr3
, so that it is never possible to match?
Thanks?