diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h
index 2eb3ad988b09fca304b71eb726cc724d301e7891..5c1f14b63823f31bcf70eeb3abb6efe9bc891f29 100644
--- a/include/libcamera/internal/media_device.h
+++ b/include/libcamera/internal/media_device.h
@@ -15,6 +15,7 @@
 #include <linux/media.h>
 
 #include <libcamera/base/log.h>
+#include <libcamera/base/regex.h>
 #include <libcamera/base/signal.h>
 #include <libcamera/base/unique_fd.h>
 
@@ -47,6 +48,7 @@ public:
 
 	const std::vector<MediaEntity *> &entities() const { return entities_; }
 	MediaEntity *getEntityByName(const std::string &name) const;
+	MediaEntity *getEntityByName(const std::regex &name) const;
 
 	MediaLink *link(const std::string &sourceName, unsigned int sourceIdx,
 			const std::string &sinkName, unsigned int sinkIdx);
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 2a848ebed99894fff3e44fad63e1f17d0ba9d647..8c82a2b1488b4d72eb3e0930f04ff604395e9f92 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -342,6 +342,32 @@ MediaEntity *MediaDevice::getEntityByName(const std::string &name) const
 	return nullptr;
 }
 
+/**
+ * \brief Return the MediaEntity with name matching the regex \a name
+ * \param[in] name A regex to match the entity name
+ * \return The entity matching the regex \a name, or nullptr if no such entity
+ * is found or multiple entities match on \a name
+ */
+MediaEntity *MediaDevice::getEntityByName(const std::regex &name) const
+{
+	MediaEntity *entity = nullptr;
+
+	for (MediaEntity *e : entities_) {
+		if (!std::regex_search(e->name(), name))
+			continue;
+
+		if (entity) {
+			LOG(MediaDevice, Error)
+				<< "Multiple entities match given regex";
+			return nullptr;
+		}
+
+		entity = e;
+	}
+
+	return entity;
+}
+
 /**
  * \brief Retrieve the MediaLink connecting two pads, identified by entity
  * names and pad indexes
