regular-language Questions

2

Solved

I'm curious about which (if any) real-world programming languages have a regular grammar (i.e. the set of all syntactically correct programs is regular). See also this question: What programming l...
Pelpel asked 11/4, 2011 at 12:34

2

How can I prove if L = {a^n b^m | n>m} is a regular or irregular language?
Doha asked 2/3, 2013 at 11:46

7

Solved

In a CS course I'm taking there is an example of a language that is not regular: {a^nb^n | n >= 0} I can understand that it is not regular since no Finite State Automaton/Machine can be writt...
Cardin asked 22/2, 2010 at 8:52

5

Solved

I know anbn for n > 0 is not regular by the pumping lemma but I would imagine a*b* to be regular since both a,b don't have to be the same length. Is there a proof for it being regular or not?
Botanical asked 23/5, 2013 at 20:21

6

Write an expression that contains an even number of 0s or an odd number of 1s I got it down to: 1*(01*01*)* + 0*10*(10*10*)* where the first part represents an even number of 0s and the second par...
Semiliterate asked 10/12, 2013 at 3:28

2

Solved

I have a little confusion in checking whether the given language is regular or not using pumping lemma. Suppose we have to check whether: L. The language accepting even number of 0's in regular...

3

I have a directory ~/x7/music/sfx. There are some files and folders in the root of ~/x7/music. I need to sync only the sfx folder and ignore anything else in music. I've tried many variants, but ...
Lesko asked 8/7, 2016 at 13:45

2

Given two non-regular languages, is their union regular? Also, why is L = L1 ∪ L2 = {aibj | i,j >= 0} the union of L1 = {aibj | i >= j} and L2 = {aibj | i < j}? Then, what is the union of L1 =...
Query asked 19/1, 2020 at 12:23

2

Solved

I was looking at the question posed in this stackoverflow link (Regular expression for odd number of a's) for which it is asked to find the regular expression for strings that have odd number o...
Centrosome asked 28/10, 2019 at 12:20

3

Solved

This is a theoretical Computer Science question (Computation Theory). I know that RegExps can take a very long time to calculate. However, from Theory of Computation we know that matching with a R...
Swill asked 30/8, 2019 at 18:45

3

Solved

My problem may sounds different to you. I am a beginner and I am learning Finite Automata. I am googing over Internet to find the Regular Expression for Finite Automata of Given Machine Below. ...

13

Im having a problem in solving the problem:- Its an assignment, i solved it, but it seems to be too long and vague, Can anyboby help me please...... Regular expression for the strings with even nu...
Pantaloon asked 13/9, 2010 at 7:50

2

Solved

I am learning the sed s/regexp/replacement/ command on linux. There are some numbers from phone.txt (555)555-1212 (555)555-1213 (555)555-1214 (666)555-1215 (777)555-1217 I'd like to use the reg...
Gobbler asked 30/12, 2018 at 19:32

1

Solved

I'm trying to process an xml, before that i need to remove the doctype and entity declaration from the input xml. I'm using the below code to remove the doctype and entity: fileContent = fileCont...
Criollo asked 16/11, 2018 at 9:8

2

Solved

This is the DFA i have drawn- Is it correct? I am confused because q4 state has 2 different transitions for same input symbol which violates the rule of DFA, but I can't think of any other solut...
Republic asked 2/1, 2013 at 13:15

2

Solved

I nedd to add a-zA-ZáàâäãåçéèêëíìîïñóòôöõúùûüýÿæœÁÀÂÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙÛÜÝŸÆŒ x time but I find this very ugly. So I try \p{L} but it does not working in JavaScript. Any Idea ? my actual r...
Carlow asked 4/5, 2018 at 15:35

1

Solved

Please, I need to validate Iranian postal code using regex. I write this regex for this case \b([^02\n\D]){4}[^5](\d){5} but its not working on rule number 5 and 7. please help me to fix it. this ...
Yellowlegs asked 10/2, 2018 at 10:36

2

Solved

I need help with constructing a left-linear and right-linear grammar for the languages below? a) (0+1)*00(0+1)* b) 0*(1(0+1))* c) (((01+10)*11)*00)* For a) I have the following: Left-linear S -...
Eurythmic asked 11/12, 2012 at 8:38

1

Solved

I have 2 simple lexer rules in my ANTLR4 grammar: fragment Attrs : '.' ARCH; fragment ARCH : 'IA32' | 'X64' | 'IPF' | 'EBC' | 'common'; The generated ATN with ANTLR4.7 is like this (Visual Studio...
Snooty asked 3/8, 2017 at 1:25

2

I've tried to look for the answer and I'm getting conflicting answers so I'm not sure. I know the reverse is true, that if L is regular then L* is regular under closure. I imagine that if L* is r...
Fundus asked 2/10, 2014 at 16:14

4

Solved

I am trying to replace commas bounded by nonwhite space with a white space, while keeping other commas untouched (in R). Imagine I have: j<-"Abc,Abc, and c" and I want: "Abc Abc, and c" ...
Montanez asked 1/3, 2017 at 12:39

0

This article say: A backreference like \1 or \2 matches the string matched by a previous parenthesized expression, and only that string: (cat|dog)\1 matches catcat and dogdog but not cat...
Timbale asked 7/11, 2016 at 0:2

6

Solved

For example, in an assignment given to me, we were asked to find out if two regular expressions are equal or not. (a+b+c)* and ((ab)**c*)* My question is how is one supposed to do that? If I dra...
Radiate asked 22/1, 2012 at 14:8

2

What are the minimum pumping length for the following languages ? The empty language (01)* 10(11*0)*0 1011 011 U 0*1* Here are my solutions. Please correct me if I'm wrong. p = 0 because the...

4

I read this in a book on computability: (Kleene's Theorem) A language is regular if and only if it can be obtained from finite languages by applying the three operations union, concatenation, ...

© 2022 - 2024 — McMap. All rights reserved.