Skip to main content

Questions tagged [regular-expressions]

According to Wikipedia, a regular expression (abbreviated regex or regexp) is a sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations.

1 vote
4 answers
242 views

I have a proprietary protocol that describes the exchange of messages of two participants (applications) via a messaging broker (mqtt). A participant is of type A or B. Each type is allowed to send ...
olimtrail's user avatar
12 votes
2 answers
3k views

My employer has a significant number of company-internal strings which require format validation. For instance, order number AAA-BBB-CCC, stock number AB-123456 or factory ABC1 - Regex with extras (...
MikeFoxtrot's user avatar
1 vote
1 answer
952 views

Background I have been attempting to create a line editor in C, eventually becoming a visual editor, and as a means of both allowing the editor to be useful but also learn more about C development, I ...
greybrunix's user avatar
31 votes
6 answers
13k views

Say I have a have request payload PUT /user { email: "invalid" ... } In the backend there is a email regex, which I cannot modify. Currently the behavior is to output: { "error&...
夢のの夢's user avatar
1 vote
2 answers
5k views

Background I do programming with Python and now and then i run into a situation where i have to use regex Typically i try to learn a bit about it and look at examples of doing things similar to what i'...
sunyata's user avatar
  • 477
0 votes
0 answers
177 views

I am working on a DSL for text processing. The core is searching for regular expressions with some operators around them. These searches are embedded into a more procedural program, which allows for ...
flowit's user avatar
  • 237
-5 votes
1 answer
1k views

If I try to rewrite specific regex functionalities (e.g. substituting a string) in Python, a solution using the regex module is always faster. Is regex written in C?
gython's user avatar
  • 93
3 votes
3 answers
3k views

I'd like to match a regex pattern on a stream, but I am not sure what algorithm to use. I certainly don't want to load the entire file into memory. I tried to figure out how to do this, but I have ...
inf3rno's user avatar
  • 1,259
-4 votes
1 answer
3k views

I have lots of experience with regexes. I just want to make sense of this. Am I missing something here. Which one of these would you rather validate with a regex? Question reads, Which of the ...
Evan Carroll's user avatar
0 votes
1 answer
67 views

I have a class of (flat) objects that are going to be passed around between three different parties, each possibly running a different software stack. my_object: item: "string_a" money: ...
ShapeOfMatter's user avatar
1 vote
1 answer
306 views

I am wondering if it is possible to create a regular language from a irregular language if we add or remove finite number of words from it? say L is irregular, can we add or remove finite number of ...
mathnoobie's user avatar
2 votes
4 answers
3k views

Restructuring some code, and the way I built it up over time has portions that look something like this: s.replace("ABW"," Aruba "); s.replace("AFG"," Afghanistan "); s.replace("AGO"," Angola "); s....
Anon's user avatar
  • 3,649
1 vote
1 answer
4k views

The goal of the RegEx is to match exactly 6 characters, but in addition it should match empty strings or white space (e.g: ^$|\s|^(\w){6}$). Is it good practice check for empty string/white space in a ...
fortune's user avatar
  • 157
3 votes
1 answer
211 views

In Regular Expressions Quick Start, it reads Twelve characters have special meanings in regular expressions: the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or ...
Wizard's user avatar
  • 167
9 votes
4 answers
507 views

I am aware of Regular Expression Denial of Service (ReDoS). Is there any reasonable way to allow users to create custom regexes while guaranteeing that they don't submit an exponentially slow pattern?
icirellik's user avatar
  • 429

15 30 50 per page
1
2 3 4 5
7