Skip to main content
Code Review

Questions tagged [regex]

Regular expressions are a declarative language, mainly used for pattern matching within strings. Please include a tag specifying the programming language you are using, together with this tag.

Filter by
Sorted by
Tagged with
6 votes
2 answers
400 views

I am trying to write a simple tokenizer for a basic arithmetic calculator. Here's the code: ...
10 votes
6 answers
1k views

I'm working on a Python script that reads a text file and extracts all the unique email addresses. The code works as intended, it produces the correct output, throws no errors, and I've tested it on ...
6 votes
2 answers
740 views

Here's my (correct) solution to a HackerRank question: Weather Observation Station 8 Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last ...
3 votes
1 answer
178 views

I have created a simple text editor with a "replace all" feature. It's meant to be part of a larger project, so it needs to be robust and work reliably across various scenarios. Please ...
5 votes
1 answer
147 views

This is my first Rust project (I'm primarily a C guy). I want to know if my code is properly idiomatic (Rusty?). Also, are there any inefficiencies? The code defines an iterator (...
0 votes
0 answers
99 views

I want to share my invention, which allows you to use only one RegEx, which will search for substrings in a string with a certain condition. If you want, call it a RegEx loop that didn't exist before! ...
4 votes
1 answer
103 views

I've made a code in Python 3 which converts a polynomial with integer coefficients (in simplified integer form) from string form to a list of tuples of the form (coefficient, exponent, variable). It ...
Sam's user avatar
  • 147
2 votes
2 answers
161 views

I would like to know if there is a better regex to match all worded numbers from 1 to 99. With "better" I mean shorter with same performance, OR faster. I came up with this. I can't do ...
1 vote
1 answer
71 views

I have a Polars dataframe in which the cells contain a sequence of single digits as a string of characters, and I want to find the number of differences between the single-digits elements of the ...
5 votes
1 answer
397 views

I attempted to implement a python version of this function in my previous question. Given a regular expression with range(s) of alphabets/numbers, the function will expand the brackets and return a ...
nightstand's user avatar
2 votes
0 answers
112 views

I tried writing a short function that expands brackets [] within a regular expression. Given a regular expression, the function will expand the brackets and return ...
nightstand's user avatar
3 votes
1 answer
148 views

I have written code to manage a string and retrieve from it a dictionary which must contain pairs key-value dependent from the string. To be more clear I'll show ...
2 votes
1 answer
111 views

I've implemented a function that creates a multiple regular expressions predicate. The idea behind the predicate is combining regular expressions using the disjunction operator ...
1 vote
1 answer
184 views

Task-description: Implement a function, which returns a string with all consecutive whites-spaces replaced as a single-space. Example: "a[space][space][space]b[space][space][space]c" shall ...
2 votes
1 answer
90 views

I made a function that prompts me for values of variables (formatted %^{var1}) it found in a string and fills in said values. ...

15 30 50 per page
1
2 3 4 5
...
58

AltStyle によって変換されたページ (->オリジナル) /