<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/1ogong8mg" -->

---
title: PHP fun: regex builder in 8.5 | daily.dev
description: Explores using PHP 8.5&#x27;s new pipe operator as an alternative to fluent API builders for constructing regular expressions. Demonstrates how functional...
canonical: https://daily.dev/posts/1ogong8mg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: PHP fun: regex builder in 8.5 | daily.dev
og:description: Explores using PHP 8.5&#x27;s new pipe operator as an alternative to fluent API builders for constructing regular expressions. Demonstrates how functional...
og:url: https://daily.dev/posts/1ogong8mg
og:image: https://api.daily.dev/og/posts/1OgONG8MG.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP fun: regex builder in 8.5

**[PHP Dev](https://daily.dev/sources/phpdev)** · [@damienseguy](https://daily.dev/damienseguy) · 14 upvotes · 0 comments

## Summary

Explores using PHP 8.5's new pipe operator as an alternative to fluent API builders for constructing regular expressions. Demonstrates how functional composition with pipes can create regex patterns with less code and fewer side effects compared to object-oriented builder patterns. Shows practical examples of converting C# regex builder methods into PHP pipe operator functions, including character patterns, quantifiers, lookaheads, and groups. Argues that pipe operators offer simpler testing, easier extensibility, and language-level regex building, though acknowledges the trade-off of less intuitive naming compared to fluent APIs.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/xwero/php-fun-regex-builder-in-85-3in6>

## Similar posts on daily.dev

- [Governing Security in the Age of Infinite Signal](https://daily.dev/posts/governing-security-in-the-age-of-infinite-signal-qhihbir44) · Snyk · 0 upvotes · 0 comments
- [No one has a good plan for how AI companies should work with the government](https://daily.dev/posts/no-one-has-a-good-plan-for-how-ai-companies-should-work-with-the-government-nkajqoze1) · TechCrunch · 0 upvotes · 1 comments

---

Tags: [#php](https://daily.dev/tags/php), [#functional-programming](https://daily.dev/tags/functional-programming), [#design-patterns](https://daily.dev/tags/design-patterns)

[View this post on daily.dev](https://daily.dev/posts/1ogong8mg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/1ogong8mg","headline":"PHP fun: regex builder in 8.5","text":"Shared: PHP fun: regex builder in 8.5","url":"https://daily.dev/posts/1ogong8mg","datePublished":"2026-01-31T06:46:38.798Z","dateModified":"2026-01-31T06:47:18.178Z","author":{"@type":"Person","name":"Damien seguy","url":"https://daily.dev/damienseguy","image":"https://media.daily.dev/image/upload/s--nPbjKqol--/f_auto,q_auto/v1698422671/avatars/avatar_G85JhYcDxAg024Omc8Rlp","description":"PHP developer passionate about deep language knowledge, testing, static analysis, and sustainable it","worksFor":{"@type":"Organization","name":"Exakat","logo":"https://media.daily.dev/image/upload/s--ibtl6fze--/f_auto/v1749051132/companies/exakat"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":35860}},"image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":14},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/r8Bt2Va8m"},"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/phpdev","name":"PHP Dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHP Dev","item":"https://daily.dev/squads/phpdev"},{"@type":"ListItem","position":3,"name":"PHP fun: regex builder in 8.5"}]}
```

