Skip to main content
1 vote
1 answer
32 views

I have file names with text in them that looks like "1999_2000" (year followed by underscore then year). The years change. I want to change the underscore to a hyphen ("-"). I'...
user8229029's user avatar
  • 1,273
-9 votes
0 answers
141 views

I want to remove all special characters from a string except emojis. var stringWithEmoji = "test 😎"; var cleanedString = stringWithEmoji.replace(/[^a-zA-Z0-9\s]/g, ''); The above replace ...
Paul Kendal's user avatar
0 votes
1 answer
114 views

Is there a better way to define a regexp that captures only letters but not a given letter, for example not "S" or "s"? [^Ss] -> this one does not limit the characters to ...
glapka's user avatar
  • 35
Advice
2 votes
11 replies
167 views

I need to construct a regex given an integer n that matches any partition of n with a leading +. For example, if n=10, it should match +10, +9+1, +1+9, +1+8+1 etc. Since there are only finitely many ...
nonhuman's user avatar
  • 140
0 votes
2 answers
69 views

I use Jinja2 and mixhtml for validating length of the input from the user. From my app.py two cons USER_USERNAME_MIN = 2 USER_USERNAME_MAX = 20 But I'm not sure how to place them into the input ...
ktj_jcbsn's user avatar
-3 votes
4 answers
174 views

I am looking to write a regex pattern that recognizes when my text has a single open parenthesis. I wrote this code below to search for a single left hand parenthesis with no right hand parenthesis. I ...
user8421's user avatar
Best practices
0 votes
18 replies
350 views

I often struggle to decide which regex pattern fits a requirement. How do experienced programmers approach designing regex? Do they memorize common patterns, build them step by step, or rely on ...
Suhail T's user avatar
0 votes
3 answers
135 views

This will be used in a Classic ASP (VBScript) project. I am trying to find the words that are NOT in line with a starting single quote. Regex example of finding all words. (\b(CreateObject|Set|Open)\b)...
CodingEE's user avatar
  • 341
4 votes
4 answers
228 views

I would like to use a Perl one-liner to modify numeric values in a text file. My data are stored in a text file: 0, 0, (1.263566e+02, -5.062154e+02) 0, 1, (1.069488e+02, -1.636887e+02) 0, 2, (-2....
mabalenk's user avatar
  • 1,095
2 votes
1 answer
76 views

I want to use a regular expression in Mulesoft Dataweave and substitute some values by using variables. I have this code which excecutes fine in Dataweave: "1000000087" replace /^(.{3}).(.{6}...
Ben's user avatar
  • 864
1 vote
2 answers
206 views

We have a capture group of Z, and we want to display this capture group X number of times using regex in PHP. I can not find a working syntax for this. For example: This captures the "Z" 5 ...
Mm-Art-In's user avatar
  • 23.1k