let me break it down for you
so there are three regex in it, as after new additions now all three are accepted as valid BCH addresses now
/^([13]{1}[a-km-zA-HJ-NP-Z1-9]{33}|(bitcoincash:)?(q|p)[a-z0-9]{41}|(BITCOINCASH:)?(Q|P)[A-Z0-9]{41})$/
Breaking it down
First type of addresses
[13]{1}
address will start with L, M or 3, {1} defines that only match one character in square bracket
/[13]{1}[a-km-zA-HJ-NP-Z1-9]/
cannot have l (small el), I (capital eye), O (capital O) and 0 (zero)
/[13]{1}[a-km-zA-HJ-NP-Z1-9]{26,33}/
can be 27 to 34 characters long, remember we already checked the first character to be 1 or 3, so remaining address will be 26 to 33 characters long
second type of address
bitcoincash:
will start with bitcoincash:
(bitcoincash:)?(q|p)
followed by q or p
(bitcoincash:)?(q|p)[a-z0-9]
can only have lower case letters and numbers
(bitcoincash:)?(q|p)[a-z0-9]{41}
will be 54 characters long, we already checked first 11 characters to be bitcoincash: followed by another character to be Q or p, so remaining address will be 41 characters long
third type of address
BITCOINCASH:
will start with BITCOINCASH:
(BITCOINCASH:)?(Q|P)
followed by Q or P
(BITCOINCASH:)?(Q|P)[a-z0-9]
can only have lower case letters and numbers
(BITCOINCASH:)?(Q|P)[a-z0-9]{41}
will be 54 characters long, we already checked first 11 characters to be BITCOINCASH: followed by another character to be Q or P, so remaining address will be 41 characters long