Closed plocket closed 3 years ago
May have found an answer to this in 4 or 5:
?:
, regex101, in there for the totality of the second group to avoid the extraneous found group]Actually did end up needing to use this, so glad it's sorted! Used 6 to capture each group.
[May have found an answer, though it needs thorough testing. Not sure how I did it without a positive look ahead, but...]
Working towards this challenge:
(.*?)(?:(_mail_address)|(_address)|(_phone))$
. See and test the use of this regex~. [Regex101 failed me. Showed it to me as working when a reload showed it wasn't.](.+?)((_mail)|(_phone))?((_mail)+|(_address)+|(_phone)+)$
https://regex101.com/r/NlvtQa/8/ [(Unfortunately means splitting up our words more and I'm not sure how scaleable that is, but it might be. Also, matches 'z_mail_mail_address`. Is that correct or not?)](.+?)(?:(?:_mail_address)|(?:_address)|(?:_phone))+$
https://regex101.com/r/NlvtQa/10 if the behavior with those middle lines is as desired.(.+?)(?:(?:_mail_address$)|(?:_mail_address_address$)|(?:_address$)|(?:_address_address$)|(?:_phone$))
https://regex101.com/r/NlvtQa/14/(.+?)((_mail_address$)|(_mail_address_address$)|(_address$)|(_address_address$)|(_phone$))
https://regex101.com/r/NlvtQa/13