Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

I have two finite sets of strings S_1, S_2 that are described by DFAs (e.g. these sets are regular languages, but I want to emphasize the fact that they are finite of known maximum length). I need to ...
zugzwang's user avatar
3 votes
1 answer
73 views

I'm given this deterministic finite automaton (DFA): I have to construct a regular expression for it. I do not understand one thing in the method described in my handbook. First of all, we have to ...
Douglas Richard Landa's user avatar
0 votes
0 answers
25 views

I will start with specific examples since I lack the term I am looking for. Let's start with the regex [^x]xyx[^x]. The regex matches string abcxyxdef. The regex begins to match string abcx, and might ...
jojo hohanon's user avatar
-1 votes
1 answer
59 views

There's no better way of explaining than with an example: say I have a for loop: for(int i = 0; i<n;i++){ I basically want a regex that groups i = 0, i<n, and i++ into three separate groups. ...
user23033721's user avatar
-3 votes
1 answer
163 views

For my exercise I'm supposed to create two DFA's. The task specifically is: Construct a DFA over the alphabet Σ={1,0} accepting the following regular languages. a) An arbitrary long sequence of zeros ...
Auxelia's user avatar
  • 11
-1 votes
3 answers
228 views

Seeking help with a regex task: Constructing a pattern for words over {a, b,c} with #a(w)≥2 and #b(w)≥2 c has no limitations . Need solution assistance. example for words that are in the language: ...
Shahar David's user avatar
0 votes
1 answer
276 views

I am trying to write a regex to match strings with even instances of ab and ba with only the alphabet of {a,b}. I am trying to do so with only | and * operators. I think it has something to do with ...
Elijah Williams's user avatar
1 vote
1 answer
46 views

I'm trying with regular expression to select text between two () characters, complete with characters included. EX. Text (the text) -> (the text) EX2. Text text text (the text again) -> (the ...
Mae Smets's user avatar
3 votes
1 answer
1k views

Consider the language L = {w|w doesn't contain the substring 110} over the alphabet Σ = {0,1} Write the regular expression Currently I have the regular expression as 0*(10*10)*1* But the autograder ...
DaneShuler's user avatar
0 votes
1 answer
434 views

I want to create a regular expression of odd lengths of a and b. I found this solution on Stack Overflow: ((a+aaa)*(b+bbb)*(a+aaa)*(b+bbb)*(a+aaa)*)*(ab+ba)......... I found it to be correct from ...
sachin yadav's user avatar
2 votes
2 answers
245 views

So I am a newbie computer science person and would like some help from the community in helping me understand this subject. I have this regular language I am trying to determine is 3 things from this ...
cool cat's user avatar
0 votes
1 answer
272 views

I want to implement a formatted SQL function on the front end. Among them, SQL may contain some mybatis-specific syntax, such as '#{var}'. The input is SQL compressed into one line; the output is ...
We He's user avatar
  • 1
-1 votes
1 answer
55 views

It's a question in CS courses "Theory of Computation", about proofs of regular or non-regular language. How to prove {(a^m)(b^n)(c^k): m!=k and m,n,k ∈ N} is non-regular? I try to solve it ...
李力扬's user avatar
-1 votes
1 answer
229 views

I want to trigger a pipeline for cases where it only triggers two cases when the event received is failed or successful using the Jenkins webhook trigger. enter image description here for eg: If I ...
damini chopra's user avatar
0 votes
3 answers
147 views

I tried ^(a|b|c)?(a|b|c)*\1$ and some variations but for some reason words like a or b aren't captured. Could you guys explain me why? I also don't get why in the expression ^(a|b|c)?(a|b|c)\1$ the ...
Gustavo Calanzani's user avatar
5 votes
2 answers
721 views

I've looked through tons of stuff and all point to just add a space in the regex but it doesn't work for me, can you explain why and how can I make it work? Right now the expression I am using is this ...
Bani Akram's user avatar
0 votes
0 answers
21 views

I want to Rewrite my url using .htaccess file using php as I got hundreds of url's like this and I don't want to add individual RewriteRule for these many url's. I want to remove numbers from start of ...
SIHala's user avatar
  • 11
0 votes
0 answers
23 views

(cd+)+? I have cd+ to {cd, cdd, cddd, ...} but I do not understand how to apply the + from the parenthesis. I saw that if it is like (d*)* then it is same as d* but here its not just d* in it but c ...
Wamiq Ur Rehman's user avatar
1 vote
1 answer
2k views

In automata theory, we can use Myhill–Nerode theorem to prove that a language is not regular. The theorem makes use of the concept of distinguishable and non-distinguishable strings. While it is ...
mindoverflow's user avatar
0 votes
2 answers
105 views

I would like to use Lark to generate a standalone parser for a small rational language of mine. This needs to be a LALR(1) parser. It should accept the following input: (lorem) consectetur adipiscing ...
Aristide's user avatar
  • 4,124
0 votes
0 answers
54 views

I am implementing the lexical and syntax analyzer for a c++ like programming language I have the following line in the regular expressions' section in lex file arithm_op [/+*%-] bitwise_op [...
Noran Hany's user avatar
1 vote
1 answer
27 views

I need a regular expression that allows: You cannot put a space at the beginning and end of a line There can only be one space between words I had enough for something like "^[АЯ-Ёа-яё0-9' ']+$&...
Riblick's user avatar
  • 13
0 votes
1 answer
211 views

Here is the language and I want to create a context-free grammar for it: b(bc+a)*a(a+b)*c* Here is my answer but I don't know if it's right or not: S → bAaB A → bcA | aA | epsilon B → cB | aB | ...
zephyrus's user avatar
1 vote
1 answer
522 views

I'd like to create a function that's capable of splitting a string containing multiple sentences by dots, but at the same time handles abbreviations. For example, it shouldn't split after "Univ.&...
Chloe's user avatar
  • 93
1 vote
3 answers
209 views

I want to find all lines that contain at least two vowels. I tried to use the sentence: .*[aeiou].{2,}\n But it seems that it doesn't succeed, in this failed result it still contains even lines with ...
ddd's user avatar
  • 9
2 votes
0 answers
175 views

Fix strings x and y, |x| < |y| = n. For any 2 strings of different lengths, there is a DFA with O(logn) states that accept x and rejects y. Prove that this DFA exists. My approach: I tried to find ...
Charlie's user avatar
  • 121
0 votes
1 answer
150 views

The start state cannot have any "in edge" (an arrow point directly to the start state) and only out edge is possible for the start state. Other states except the start state are free of ...
Pouya Kafashi's user avatar
0 votes
2 answers
178 views

The alphabets of a regular language are ∑={a,b,c} I need create regular expression for: a.) Accepts strings that do not have two 'b' characters next to each other. example: aabccbaaccb <- allowed ...
Henrik Eronen's user avatar
0 votes
1 answer
91 views

The given language is: B = { aibic2m | i ≥ 0, m ≥ 0 } ∪ { arbsc2t | r ≥ 4, s ≥ 4, t ≥ 0} My Prof has provided a regular expression for this language which is: a4a* b4b* (c2)* + (epsilon + ab + a2b2 + ...
RipLearning's user avatar
0 votes
0 answers
189 views

Is there any way to use a counter in context-free grammars? I need to add a module number (for example starting from M1:0, M1:1, ... , M1:K representing the module number) and I want to count every ...
S.EB's user avatar
  • 2,236
2 votes
1 answer
462 views

There is this proof that I thought of that I am not quite sure if it's valid or not. Suppose you had to prove the nonregularity of the following language: A = { 0^n 1^n 2^n | n>= 0 } The proof I ...
Mr Bones's user avatar
2 votes
1 answer
685 views

In our course of Theory of Computation, we have done the proof for closure of regular languages(L1, L2) under intersection, union and complement. But their closure under concatenation(L1L2) and star(...
Aakash Tiwari's user avatar
1 vote
1 answer
563 views

How to construct unrestricted grammar that generates L = {a^ib^j c^k^d^l : i not equal to k AND j not equal to l}. a is to the power of i, 'b' raised to the power of j, 'c' raised to the power of k, '...
newman's user avatar
  • 21
0 votes
1 answer
41 views

Define a regular expression for the alphabet {a,b} where subsequences of a's that aren´t empty are always even and subsequences of b's are always odd. I have something like this but I think it works ...
Alejandro Hernández's user avatar
1 vote
1 answer
76 views

The expression allows me to capitalize the first letter, then I put the continuation of the word and tell it that I only allow small case characters and do not limit their number. I expect it to ...
Mr.Mox's user avatar
  • 29
-1 votes
1 answer
611 views

(https://i.sstatic.net/lU278.png) Why option C is also not correct?
Naina's user avatar
  • 11
2 votes
1 answer
862 views

I'm working through some exam questions for a module in college. I've been asked to create a regular expression that recognises all words that have an even number of ’1’s and starts and ends with a ’0’...
coder2410's user avatar
2 votes
2 answers
1k views

I'm trying to write up an expression that starts with a '#" and takes in the following types of paths and only takes in a character A-z/a-z and doesn't accept digits or special characters: ...
Jessica M.'s user avatar
0 votes
0 answers
38 views

There is a string text <R-PORT-PROTOTYPE> <SHORT-NAME>VtDBGO_ReMotTqReqL2_null</SHORT-NAME> <REQUIRED-COM-SPECS> <NONQUEUED-RECEIVER-COM-SPEC> <DATA-...
pipixia_626_'s user avatar
-2 votes
1 answer
68 views

Can you help me to understand this code line by line please? def word(w) pattern = re.compile(r'^[^aeiouAEIOU]+') if re.findall(r'[^aeiouAEIOU]y[^aeiouAEIOU]', w): pattern = re....
Ксения's user avatar
0 votes
3 answers
533 views

I have a file that is a python code (may not be syntactically correct). It has some functions which are commented out except the signature. My goal is to detect those empty functions using a regex and ...
ishandutta2007's user avatar
2 votes
3 answers
548 views

Is there a way using grepl or another function to detect all words that have accent? Not ignoring it, which has been ask many times, just to detect all the words that have any accent in it. Thanks
anon01's user avatar
  • 23
-1 votes
1 answer
161 views

Using the pumping lemma, we can prove that {a^nb^n | n >= 0}, but what is not clear is the following. {a^n | n >= 0} is regular by itself and so is {b^n | n >= 0}, and if I am not mistaken, ...
user19187727's user avatar
0 votes
0 answers
256 views

This is an exercise from software foundation. I have proved weak pumping lemma, but I don't know how the prove the strong one. When I try proving the third case 'App', I can't deal with length (s1 ++ ...
silver-ymz's user avatar
0 votes
1 answer
596 views

I am trying to understand regular languages. I found this question here https://www.sanfoundry.com/automata-theory-multiple-choice-questions-answers/ Is L = {a^i b^i | 0<i<5} regular? The answer ...
tonythestark's user avatar
1 vote
1 answer
433 views

this is code #include <iostream> #include <regex> using namespace std; static void search_by_regex(const char *regex_s, const string &s) { // ① regex ...
WD-ZxXsQj's user avatar
0 votes
0 answers
45 views

Why it is impossible to specify a single DFA that accepts 𝐿≡∪𝑛∈N𝐿𝑛, although an individual machine can be constructed for each 𝑛?
Aries's user avatar
  • 1
0 votes
3 answers
122 views

I have the following string [1] weight | width | depth | 5.0 cm | 6.0 mm^2 | 10.12 cm^3 From that I need to extract the name, value and units from the above string like below name = weight value = 5....
Aneesh Narayanan's user avatar
0 votes
2 answers
141 views

I have the follwing string [1] weight | width | depth | 5.0 kg | 6.0 mm^3 | 10.12 cm^2 From that I need to extract the unit strings only unit=kg unit=mm^3 unit=cm^2 I tried the below regex (?<...
Aneesh Narayanan's user avatar
0 votes
2 answers
71 views

I don't know how to express the question in English title exactly, there are 2 rules firstly, met the given length as long as possible on the head and end part then match the other pattern for ...
oyster's user avatar
  • 567

1
2 3 4 5
19