I just got asked if regular expressions match strings, or if strings match regular expressions; and I don’t think I’d realised just how deep a question that is and now I’m starting to question the very nature of really itself.

@davep Does a USB plug match a USB socket, or does a USB socket match a USB plug?

Purely from a linguistic standpoint, I'd consider the string to be a "static" thing, a value, and the regex to be the "dynamic" thing, an operator. So I'd say the regex is the agent in the statement and that the regex is the one doing the matching.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.