UR::Bo...::Like(3pm)

πŸ“¦
version 0.470 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ¦‹ NAME πŸ¦‹

UR::BoolExpr::Template::PropertyComparison::Like β€” bestie, this is the little comparison class that does an SQL-ish like test. It lives in the UR::BoolExpr::Template::PropertyComparison crew, and yeah, it's from the User Contributed Perl Documentation, section 3pm. She's a Perl module, she's a baddie, she matches strings. πŸ’…


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, and it's actually so simple:

The test value you hand in is assumed to be an SQL like value. That means the string you give it is not a plain literal, it's a pattern, and two characters are doing special main character work in there:

  • _ β€” represents a one character wildcard. One char. Just one. She's not greedy, she's precise. πŸŽ€
  • % β€” represents a 0 or more character wildcard. Could be nothing, could be everything. She contains multitudes. ✨

That SQL-ish value gets converted into a perl regular expression, and then that regex is used to match against an object's properties. That's the whole vibe check right there. 🌸

And here's the part you'd definitely ask about, bestie: if the property returns multiple values, this comparison returns true if any of those values match. Not all of them. Not the first one. Any. One hit and she's slaying. πŸ”₯

no cap, this is the entire module. short, iconic, does exactly one job and does it. πŸ‘‘

🌈 SEE ALSO 🌈

ngl there's nothing extra listed on this page, so if you need more, go read the rest of the UR::BoolExpr::Template::PropertyComparison family. iykyk 🫢


that's the whole page, bestie πŸ’œ this one's from the User Contributed Perl Documentation, running on perl v5.32.1, dated 2022-01-17 β€” mwah, drink your water, and go match some strings responsibly πŸ§šπŸ“

πŸ“¦ where this page comes from