Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7901881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:20:50+00:00 2026-06-03T09:20:50+00:00

When reading up on functional programming I’ve stumbled upon the concept of Higher Order

  • 0

When reading up on functional programming I’ve stumbled upon the concept of Higher Order Functions which are, as far as I understand, functions that take functions as arguments and/or return functions as their result.

Is there an equivalent to this in the world of Regular Expressions? A Regex that operates on a Regex as to return a different Regex?

A simple (but useless) example would be:

(\w)+(?=\(er\|re\))

matches against

cent(er|re)

replacing the match with

calib

resulting in the Regex

calib(er|re)

Has anyone see this used anywhere? Can anyone think of a situation where this would be useful?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:20:51+00:00Added an answer on June 3, 2026 at 9:20 am

    I personally have not, and really can’t think of a great application off there top of my head. I think the important thing to keep in mind with regex is the idea of Turing complete. Functional programming languages are all turing complete and thus functional programming is simply another way to logically order code. Granted there are plenty of argument to be made about the merits and benefits and scalability of function programming.

    Regex, given that it is really nothing more than a text matching syntax, gains no real benefit from a functional style. This is why HTML is parsed using turing complete language parsers over a regex which would be arguably simpler to write (if it were possible).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about functional programming and I've noticed that Pattern Matching is mentioned in
I've been reading a bit about functional programming recently and am keen to get
I'm reading the book Real-world functional programming by Tomas Petricek and Jon Skeet and
I'm reading Simon Thompson's Haskell: The Craft of Functional Programming , and I'm wondering
I've been reading a lot of stuff about functional programming lately, and I can
I'm reading Conor McBride and Ross Paterson's Functional Pearl / Idioms: applicative programming with
I've been reading up on functional programming a lot recently, and I finally decided
I'm at the moment reading the book Real world functional programming, and wondering how
Functional programming .. is like classic ( Mark Twain's type ). While reading another
I have been reading many articles trying to understand the difference between functional and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.