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 304307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:16:07+00:00 2026-05-12T07:16:07+00:00

I know this question seems stupid, but it isn’t. I mean what is it

  • 0

I know this question seems stupid, but it isn’t. I mean what is it exactly. I have a fair understanding of the parsing problem. I know BNF/EBNF, I’ve written grammar to parse simple context-free languages in one of my college courses. I just never met regular expressions before! The only thing that I remember about it is that context-free grammar can do all what regular expression can do.

Also, is it useful for a usual coding to parse strings? A simple example would be helpful.

  • 1 1 Answer
  • 1 View
  • 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-05-12T07:16:08+00:00Added an answer on May 12, 2026 at 7:16 am

    Regular expressions first came around in mathematics and automata theory. A regular expression is simply something which defines a regular language. Without going too much into what “regular” means, think of a language as this way:

    1. A language is made up of strings. English is a language, for example, and its made of strings.
    2. Those strings are made of symbols – called an alphabet. So a string is just a concatenation of symbols from the alphabet.

    So you could have a string (which is, remember, just a concatenation of symbols) which is not part of a given language. Or it could be in the language.

    So lets say you have an alphabet made of 2 symbols: “0” and “1”. And lets say you want to create a language using the symbols in that alphabet. You could create the following rule: “In order for a string to be in my language, it must have only 0’s and 1’s in it.”

    So these strings are in your language:

    • 0
    • 1
    • 01
    • 11001101
    • …etc

    These would not be in your language:

    • 2
    • peaches
    • 00101105

    That’s a pretty simple language. How about this: “In my language, each string [analogous to a valid ‘word’ in English] must being with a 0, and then can be followed by any number of 0’s or 1’s”

    These are in the language:

    • 0111111
    • 0000000
    • 0101010110001

    These are not:

    • 1
    • 10000
    • 1010
    • 2000000

    Well rather than defining the language using words – and these languages might get very complex (“1 followed by 2 0’s followed by any combination of 1’s and 0’s ending with a 1”), we came up with this syntax called “regular expressions” to define the language.

    The first language would have been:

    (0|1)*

    (0 or 1, repeated infinitely)

    The next: 0(0|1)*

    (0, followed by any number of 0’s and 1’s).

    So lets think of programming now. When you create a regex, you are saying “Look at this text. Return to me strings which match this pattern.” Which is really saying “I have defined a language. Return to me all strings within this document which are in my language.”

    So when you create a “regex”, you are actually defining a regular language, which is a mathematical concept. (In actuality, perl-like regex define “nonregular” languages, but that is a separate issue.)

    By learning the syntax of regex, you are learning the ins and outs of how to create a language, so that later you can see if a given string is “in” the language. Thus, commonly, people say that regex are for pattern matching – which is basically what you are doing when you look at a pattern, and see if it “matches” the rules for your language.

    (this was long. does it answer your question at all?)

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

Sidebar

Related Questions

Possibly this question seems stupid but anyway. I have a script file /local/bin/app1/script.sh and
my question seems simple and stupid but first read this, suppose you have a
I know its stupid asking this question but i cant seems to extra Value(int)
I know this seems like a repeat question, but i've read all the others
I know this kinda seems like a stupid question and with more research i
Sorry if this seems like a stupid question but im actually having a hard
I know this question might sound quite stupid, but I've tried my best and
I know this question may seems stupid since i cannot give a lot of
May be this question seems to be stupid, but strangely I find it hard
I know the title of this question is stupid, but I couldn't come up

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.