Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<gp_p_r_1>if)\s*(?<gp_i_i_c_1>\()(.*)(?<gp_i_c_c_1>\))\s*(?<gp_i_i_b_1>\{)\s*\n\s*(?<gp_b_i_1>\D.*)(?<gp_s_i_1>\;)\s*\n\s*(?<gp_i_f_b_1>\}).*(?<gp_p_r_2>else).*(?<gp_i_i_b_2>\{)\s*\n\s*(?<gp_b_i_2>\D.*)(?<gp_s_i_2>\;)\s*\n\s*(?<gp_i_f_b_2>\})
/
gm

Description

UPN Compiladores

Submitted by anonymous - 3 years ago