Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
75 views

I have next JavaScript code in a HTML document. var a="abc=def&ghi=jkl&mno=pqr".split(/(^|&).*?(=|$)/); alert("0='"+a[0]+"' 1='"+a[1]+"' 2='"+a[2]+&...
green's user avatar
  • 343
-4 votes
0 answers
69 views

In ReDoS test the following JavaScript snippet was given the flag. What could be the fix to eliminate the ReDoS flag? if (!id || !/^\d+$/.test(id)) return null;
venkateswarlu k's user avatar
Best practices
1 vote
5 replies
135 views

In Perl regular expressions, (?(DEFINE)(?<NAME>...)) creates a referencable pattern which can be executed by the "recursion" mechanism e.g. (?&NAME). This is useful if the "....
jimav's user avatar
  • 948
0 votes
2 answers
101 views

I created a pattern in .NET 8 to match and capture only two named groups in a string. I use start and end string anchors to match the whole string. However, it also matches and captures the second ...
Jlong101's user avatar
-6 votes
2 answers
130 views

I am trying to decode an encoded string k[encoded_string] to k * encoded_string. So, I am looking at using regex to accomplish this. How to construct a regex pattern which has nested / recursive ...
khteh's user avatar
  • 4,366
-1 votes
0 answers
175 views

I have a text with SQL queries from which I want to extract all the SELECT blocks: sql_que = """ select p.value_n, p.enabled from proper p; select p.value_n, p.enabled from ...
senek's user avatar
  • 83
-6 votes
1 answer
191 views

I'm trying to work out a match with 2 similar regular expressions. First one: (constraint\s+\w*)*primary key\s*((on\s+conflict\s+\w*)*\s*(autoincrement)* Second one: (constraint\s+\w*)*primary key\s*(...
Igor's user avatar
  • 6,448
Tooling
0 votes
1 replies
92 views

Is there something like div:regex('some regex'){ color:red; } or #error_message{ display:none; } There could be textbox validation done using regex in CSS. Textbox could be found using CSS like ...
jacek's user avatar
  • 1
0 votes
4 answers
274 views

I need to move some chunks of text around in a file. I am partially successful, in the sense that I can move only the first chunk successfully. The text in the file looks like this: text regtext1 ...
virolino's user avatar
  • 2,391
-1 votes
3 answers
139 views

I have a string like this... 20260317_104524__CL2418942__SOC_PM_DF_CSTATE_REGR__df_cstate_regr__df_umc_nbio_hubs_pcie_msub_\_.xml ... and I want to pluck out the bold part (SOC_PM_DF_CSTATE_REGR). ...
daveg's user avatar
  • 1,251
0 votes
3 answers
129 views

I am trying to write a simple script to process JSON5 — the idea is to convert to standard JSON and let JSON.parse() do the rest. I’m using regular expressions to do the conversion. One part is to ...
Manngo's user avatar
  • 17.2k
-1 votes
1 answer
133 views

Is it possible to have a Regex include the whole string as a named capture group as well as individual named capture groups? I am trying to parse IIS logs and can successfully extract the details I ...
Neil Riach's user avatar
Best practices
2 votes
1 replies
137 views

I'm doing text search with user entered queries against multiple sources documents. The user can enter 16 MB or 16MB and the document can contain one or the other. I could not make it with pure text ...
Clodoaldo Pinto's user avatar
Advice
3 votes
11 replies
248 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
93 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
Best practices
0 votes
18 replies
482 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
147 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
273 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
106 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
219 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.2k
6 votes
4 answers
146 views

I have a regex where a negative lookbehind and an optional group is producing a match when I'm not expecting it to. There appears to be something about their interaction that I am not understanding, ...
vr8ce's user avatar
  • 676
Advice
1 vote
6 replies
100 views

How to match any amount of Unicode characters (letters, numbers, surrogate pairs) in regex: 😆 ẘ😆 😆😆 ẘaሴ abc123 I am looking for an equivalent to /^(\[a-zA-Z0-9\]+$)/i that finds ASCII.
user3443063's user avatar
  • 1,727
Best practices
2 votes
4 replies
75 views

I need to convert informal Persian user input that represents a monetary amount into a single integer value in rials in python. The input is free-form and may include: Persian number words (e.g. یک, ...
BCompl's user avatar
  • 43
1 vote
0 answers
113 views

I have a generic function to always query my mongo collection with a limit and get the entire result in a single batch. I noticed the queries with Contains and StartWith were taking longer than ...
Carlos Siestrup's user avatar
0 votes
1 answer
124 views

I am working with older weather data files with a 3-line header. The first line identifies the station, the second provides column names, and the third gives the column units. The problem is that ...
user8229029's user avatar
  • 1,275
0 votes
2 answers
144 views

Invoice contains services and Subtotal rows: Internet_Usage 1058 187822_MB 1 000 000 PhoneCalls 48 02:42:39 2 000 000 Subtotal 3 302 5998 Parking 8 4 000 000 Subtotal 4 302 5998 sum is third number ...
Andrus's user avatar
  • 28.3k
1 vote
4 answers
113 views

%if %sysfunc(prxmatch(/^\("([A-Za-z])"\)$/, %str(&names))) = 0 and %upcase(&stringC) = N %then %do; %put ERROR: Please format as such ("obesity","diabetes&...
Health_Code13's user avatar
Advice
2 votes
6 replies
94 views

The Problem I want to create a function in Python for finding and moving files where I can specify a glob-style pattern to find source files, and then a second pattern to describe where to move them ...
OmniZ's user avatar
  • 143
Advice
2 votes
6 replies
67 views

I like powershell's features, but not a big fan of MS Powershell documentation and supplied examples. An internet searching for this kept coming up with how to remove when I wanted to replace empty ^$ ...
TMS's user avatar
  • 13
0 votes
1 answer
152 views

In a script I'm using constants (use constant ...) to allow re-use ion actual regular expressions, using the pattern from https://stackoverflow.com/a/69379743/6607497. However when using a {...} ...
U. Windl's user avatar
  • 4,918
Advice
0 votes
12 replies
6k views

I have an input string like example/123/2457 and I know the expected output would be 2457. Is it possible based on the above information to generate a regex so when that would be applied on the input ...
anshuk_pal's user avatar
0 votes
3 answers
300 views

I try with some regex to obtain only the URL of all the videos about $pattern but my $regex not work (in this case $pattern = "Greta"): $data = '<p><a href="https://www.youtube....
Yamile's user avatar
  • 55
1 vote
3 answers
233 views

I have some old data files with a large number of writing errors. An example is attached below, where some of the numbers in the .dat file are 9 digits or characters long rather than the expected 8. ...
user8229029's user avatar
  • 1,275
2 votes
2 answers
142 views

I have a string element in an XML schema that I would like to restrict to the extended Latin character set plus numbers, punctuation, whitespace, etc. I have tried the following: <xsd:pattern value=...
nickfindley's user avatar
4 votes
2 answers
198 views

I have found the answer :-) It is: ^ghf(0[0-9]|[1-4][0-9]|5[0-2])\d{3}[A-Z]{2}_v\d{2}.pdf$ I receive filenames from a client that are structured according to the following scheme: ghf50001BE_v02.pdf ...
Thorsten D's user avatar
0 votes
4 answers
173 views

Incoming with another VBA question. I'm currently have data within a column that has many line breaks, but certain lines need to be only indented 2 spaces whereas certain lines need to be indented by ...
user31504798's user avatar
-1 votes
3 answers
109 views

I want to delete all lines that end with OFF except if they contain override. Input 1765193089 socket override DiningRoom/Socket/Work/state ON 1765206025 socket evening Hall/Socket/Lantern/state OFF ...
Richard Barraclough's user avatar
-4 votes
3 answers
246 views

I’m trying to extract a specific portion of text and haven’t had success despite testing multiple patterns and looking at similar examples. After struggling for a while, I figured it was time to ask ...
Hakan54's user avatar
  • 4,119
2 votes
2 answers
188 views

I have a regular expression in an extension of java by florian ingerl to parse a latex command, \\\\DocumentMetadata(?<docMetadata>\\{(?:[^{}]|(?'docMetadata'))*\\}) but the important thing is ...
user2609605's user avatar
-2 votes
1 answer
151 views

As far as I understand, the difference between expected and actual one is NBSP (Non‐Breaking Space). I don’t know how to remove this. It doesn’t get highlighted and cannot be found using CTRL+H (...
holysh's user avatar
  • 32
-2 votes
2 answers
160 views

I’m working with .srt subtitle files in PHP and I need a regex that finds blocks containing exactly one dash (They're regular hyphens (-), not minus signs) and it starts at the beginning of a line. ...
Mwthreex's user avatar
  • 1,107
4 votes
1 answer
111 views

I'm working on a php project and I need to extract some informations from strings like : COROLLA CROSS (07/22>09/25<) I tried different patterns without success, such as: preg_match("/(?P&...
Abdel's user avatar
  • 744
1 vote
1 answer
105 views

I have this method: func isNameValid(_ value: String) -> Bool { let trimmed = value.trimmingCharacters(in: .whitespaces) guard value == trimmed else { return false } guard trimmed.count ...
Whirlwind's user avatar
  • 13.1k
0 votes
1 answer
122 views

I have a string which may or may not contain a code for an emote, all of which begin the same: "auroraa1" Such as: "auroraa1Smile", "auroraa1Bye", "auroraa1Love&...
Aurora Zetanova's user avatar
Advice
0 votes
8 replies
154 views

I want to match a string according to a pattern but only when it is not preceeded by an other pattern. const source = "abc.def.Ghi\n\ @:test(abc.def.Ghi2)"; const re = /(?!\()([a-z]\w+\.)+([A-Z]\w*)/g;...
Misiur's user avatar
  • 5,403
5 votes
2 answers
186 views

Here is a bash script: #!/bin/bash char=$'\x01' if [[ "$char" =~ ^[\x01-\x20\x7F-\xFF]$ ]] then echo "Unprintable" else echo "Printable" fi The script ought to say ...
Melab's user avatar
  • 3,062
-1 votes
2 answers
127 views

I have a Google spreadsheet with the following values: +------------+-----------------------------+ | G | F | +------------+-----------------------------+ | Hours (G)...
Michiel's user avatar
  • 8,121
-2 votes
1 answer
114 views

On Regex101, I have simple Regex with a named capture group in ECMAScript flavor: (?<name>.*) I'm trying to do the same thing in C++: #include <iostream> #include <regex> using ...
Thomas W.'s user avatar
  • 61.3k
1 vote
2 answers
154 views

I'm parsing a number of text files of different formats. Some are csv, some are xml and some even txt. I have a case statement that checks if a certain string is contained in the first 100 bytes of a ...
Ricky883249's user avatar
Best practices
0 votes
4 replies
143 views

I have a corpus of text which includes some accented words, such as épée, and I would like people to be able to easily search through it using ASCII input. Ideally, they would simply type protege or ...
hackerb9's user avatar
  • 2,161

1
2 3 4 5
5222