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

  • SEARCH
  • Home
  • 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 8763791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:52:00+00:00 2026-06-13T15:52:00+00:00

I need to split an expression (String) in pieces and call a recursive function

  • 0

I need to split an expression (String) in pieces and call a recursive function from it’s components.
The expression is something like: (a or b), or ((a and b) or c), or ((a and b) or (c or d)) (or any other expression, no matter how many brackets it has.
The operators and, or represents two functions ( Reunion and Intersection ).

For “((a and b) or (c or d))” I must call Union( F( “(a and b”) ) , F( “(c or d)” ) ).
F ( “(a and b)” ) will be Intersection(“a”,”b”) … and so on.

I managed to split two-components expressions ( “a and b” ), but I can’t handle bigger ones.

Thanks in advance!

  • 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-13T15:52:01+00:00Added an answer on June 13, 2026 at 3:52 pm

    Answer to your question lies in authomata theory. Its about grammars and language classification.

    It goes like this. There are regular grammars, and they can be covered by the reqular expression engine which implementation is a well-known java regex package for example.

    The issue is that the language you’ve described is not a regular one. So, you can’t use a regular expression engine here, its just not powerful enough. It falls into category of context free languages that can be described by context-free grammar (broader than regular group of languages).

    If you want some theory background on this, you’re welcome to read the following articles from Wikipedia 🙂

    Regular grammar

    Context free grammar

    In any case you can at least use some kind of recursive parsers as what was suggested, or as a bare minimum to take a look on “pushdown automata”.

    Automata is a technique that can resolve grammars. For regular grammars its enough to build a regular automata, for resolving the context free grammars you should build a pushdown automata.

    Again for the theoretical background and examples see the following article

    Hope this helps

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

Sidebar

Related Questions

I need a Regular expression that allows me to split the following string in
I need to write a split function in JavaScript that splits a string into
I need to split a string like the one below, based on space as
I need to split an expression like a+b-c*d/e and get a , b ,
I need a regex expression to split math expression, like: -1*x+2*y to the: -1*x
Basically, I need to split the string like one quoted argument those are separate
I need split string by commas and spaces, but ignore the inside quotes, single
I need to split a keyword string and turn it into a comma delimited
I need to split my string input into an array at the commas. Is
I need to split ABAP date like 20091101 --> "01", "november", "2009" The "01"

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.