Catman...ce_all(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ Catmandu::Fix::replace_all ✨

okay bestie, welcome to the Catmandu::Fix::replace_all page from your very own User Contributed Perl Documentation (section 3pm, iykyk) πŸ’…


πŸŽ€ NAME πŸŽ€

Catmandu::Fix::replace_all β€” search and replace using regex expressions 🌸

like, it does a find-and-replace, but make it regex. no cap.


✨ SYNOPSIS ✨

here's the whole vibe, bestie β€” we're pulling a lil substring out of a field's value πŸ¦‹:

# Extract a substring out of the value of a field
# {author => "tom jones"}
replace_all(author, '([^ ]+) ([^ ]+)', '$2, $1')
# {author => "jones, tom"}

the way that {author => "tom jones"} just became {author => "jones, tom"}?? iconic. it literally swapped the two capture groups and slid a comma in between. ate. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix β€” go say hi to the parent, she's the main character πŸ’–

lowkey important: the regex '([^ ]+) ([^ ]+)' and the replacement '$2, $1' are exactly what they are β€” don't be out here renaming them, bestie 🫢

and that's the whole page fr fr πŸ’œ this one's from perl v5.40.1, dated 2026-01-24 β€” stay slay, go fix some fields, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from