/^(a+)(b+)(c+)$(?(?{length($1) == length($2) && length($2) == length($3)})|(*FAIL))/; #### /^(a+)(b+)(c+)$/ && length($1) == length($2) && length($2) == length($3); #### /^([0-9]+)$(?(?{sqrt($1) == int sqrt($1)})|(*FAIL))/; #### /^(.*)$(?(?{is_whatever($1)})|(*FAIL))/;