2,768 questions
0
votes
0
answers
15
views
NEST Network Emulation: httperf parser fails with AttributeError: 'NoneType' object has no attribute 'group
markdown
I'm trying to run HTTP emulation experiments using NEST (Network Emulation and Simulation Testbed) but encountering parser errors with httperf output due to regex pattern mismatches.
Problem
...
0
votes
2
answers
114
views
Search / replace in R with a capture group
In a Quarto book, I mention R functions as back-quoted strings in text like this, always ending in ()
test <- "The functions `lm()` and `car::vif()` are good test cases"
I would like to ...
-2
votes
4
answers
188
views
Problem when using `/^([^\n]*?)(\n)(.*)$/m` to match multi-line string
I have a problem I don't understand:
Given a string consisting of multiple lines like this:
DB<5> x $token
0 'ACCOUNT_CHANGED = "20250728081545Z"
ACCOUNT_CHANGED_T = "...
1
vote
3
answers
145
views
vscode regex find and replace multiple group matches
How can i cover multiple matches for a single group in vscode find and replace?
my specific situation is converting an ton of arrays to objects like this
array: ['thing1', 'thing2', 'thing3'],
and ...
5
votes
2
answers
237
views
Regular expression groups are not capturing properly
I have following expression:
String formula7 = "(^TBC10.Actual.Value_<<Year>> == \"Final\" ? ^FN10101.Actual.Value_<<Year>> : ^INT805.Consensus.Value_<<...
1
vote
2
answers
91
views
How to capture a non-numeric group between two numeric groups which can sometimes contain a number of a specific format?
I have been struggling to get a regex that can capture data extracted from a not-so-clean pdf file:
Each line should contain 1. school id (5 digits), 2. school name, 3. applications#(number), 4. ...
3
votes
3
answers
129
views
regex to match all unescaped '$' in a regex string
I want to build a regex that will match all unescaped $ in strings that represents a regex.
In this case, a character is unescaped if it contains an equal number of backslashes behind it (each pair of ...
3
votes
2
answers
72
views
Extract the names and regexes of individual regex groups
For example, given regex
r"(?P<D>.8)(?P<foo>\d+)(?P<bar>[a-z]+)"
I want to return the dictionary
{'D': r'.8', 'foo': r'\d+', 'bar': r'[a-z]+'}
that maps group name to ...
0
votes
2
answers
31
views
REGEX fails when adding an optional mark to a group
In the following string blah blahTESTblab la14blah-15S rebla I'm trying to capture TEST and 15S if present.
I wrote the following regex : (TEST).*?(\d{1,2}S)?
Everything is going well until the last ?....
0
votes
1
answer
60
views
Regex filtering groups of value and key fields with optionally empty value fields
I've got a bit of a problem with coming up with the correct regex. I had to create a regex for the following text:
Feld1 = 1134 2000 0101 0202 0303
Name1 = Ein Kleiner Namens Test
Daten1 = ...
0
votes
0
answers
26
views
Regex capture key-pairs, skip missing [duplicate]
Many lines of key-value pairs, each line lives inside brackets. The key-value pairs can be in any order and/or missing. In this example all I want are 3 fields: name, age, hair color.
[name:"...
3
votes
2
answers
70
views
Split a string with key-value pairs if underscore in key
I've a string that has key value pairs with _ as their delimiter. The Problem is, there can be underscores within keys too.
What regex can I use to split these into key value pairs?
Intput:
C_OPS_CITY=...
-3
votes
2
answers
103
views
How to get second material name from product description
Product description is string like
Main fabric: 50% Organic Cotton, 49% Cotton, 1% Elastane
Material names are between % and ,
or up to end of string for last material name Elastane.
Tried to get ...
0
votes
3
answers
104
views
How to find second match in sql
Query
select (regexp_matches('Main fabric: 50% Organic Cotton, 49% Cotton, 1% Elastane', '\b(\d+)%'))[2]
returns no rows.
Regex testing https://regex101.com/r/nVP3Wg/1 returns 3 rows as expected.
...
-4
votes
1
answer
102
views
regex - error with result - too many occurence [duplicate]
For example, I have this texte (without newline - it's important) :
<div> ffjdklfjdklfjs 2015 ddddd </div> sfsfsfsfsf <div> hkh/ <> -%=:;.éggggggggggg 2018 dsqkdlmqs </...
0
votes
2
answers
78
views
Group capturing Regular expression to validate `tictac` string with repentance requirement
I'm working on a code challenge from hackerrank and wonder why my solution failed on this task. (https://www.hackerrank.com/challenges/forward-references/problem)
Task
You have a test string 𝑆.
Your ...
1
vote
0
answers
34
views
Regular expression to match an optional group in the middle of a string [duplicate]
I have a regex question that's been driving me a bit crazy. I'm parsing a file and need to match and extract specific parts of each line read. The lines come in two forms (ignore the syntax, I'm just ...
2
votes
1
answer
125
views
Regex for (x,y) and (x,y] in R [duplicate]
i'm using R, and i have a df with a column that has bins that follow one of these two formats:
(x.xx,y.yy] or (x.xx,y.yy)
they are all positive integers with multiple decimals
i want to split them ...
-1
votes
1
answer
49
views
How to create a regex with an optional group without merging it with another group? [duplicate]
I'm trying to write a regex pattern in Python to capture two groups, where the second group is optional, but I want the groups to remain distinct.
Here is are examples of the possible pattern I want ...
6
votes
1
answer
112
views
Regex $1, $2 data type conversion issue
I'm trying to add YouTube Video Bookmark somewhere.
If my YouTube Video URL is: 'https://www.youtube.com/watch?v=xxxxxx&t=12:13'
Then it should be convert as format: 'https://www.youtube.com/watch?...
1
vote
1
answer
80
views
Negative lookahead for stand alone words
I am trying to write a rule-based logic to extract information from a text. I need to assign each extracted string to each specific case. However, I am stuck working with a negative lookahead use case....
0
votes
1
answer
108
views
Bash regex using BASH_REMATCH not capturing all groups [duplicate]
In bash, I'm trying to capture this groups with this regex but BASH_REMATCH give me empty results
RESULT="1730624402|1*;[64452034;STOP;1730588408;74;22468;1"
regex="([[:digit:]]+)?|([[:...
1
vote
0
answers
194
views
Swift Regex Error: Cannot Convert 'Regex<(Substring, Substring, Substring)>' to 'Regex<AnyRegexOutput>' When Matching Patterns
I'm working on a Swift class that utilizes regex for pattern matching, but I'm encountering an error when trying to initialize the Regex type in my custom class.
class code:
import Foundation
class ...
4
votes
4
answers
228
views
Can I get help generating the correct regex to match a list of test strings?
At work I came upon a problem that required parsing of filenames that did not have a consistent pattern. I tried for a significant amount of time to implement a pure regex solution but settled for ...
-1
votes
1
answer
112
views
Regex with one special characters avoiding periods and parentheses [closed]
I am working with a Regex to validate a string with the following requeriments:
It does not start with special characters.
It can countains numbers, letters and special characters, with the exception ...
0
votes
1
answer
330
views
The regular expression for parsing Telegram usernames stops parsing valid usernames if there is an invalid username in the same line [duplicate]
I have one problem here, I have a regexp that extracts the username in Telegram links, starting from a simple "@" to username.t.me links
The problem is that if I enter @aaaa, @jfewewf, both ...
2
votes
0
answers
117
views
Get the groups that returned a match in Java Regex
I'm coding a simple Lexer in Java and the class looks like this:
public class Lexer {
// This enum contains all the possible tokens accepted by the language and their respective regular expression
...
0
votes
2
answers
82
views
Regex - Excluding text inside a word WITHOUT having to split them up into 2 capture groups and combining them using a programming language
Let's say I have the following text:
abc123def
abc1234567890def
In this text, I want to JUST capture the "abc" and the "def" parts of the text, completely excluding the numbers. ...
3
votes
1
answer
73
views
Regular expression loop makes duplicate matches due to similar words. How to avoid?
I have some kind of a Regex problem I wanted to make it as general as possible although I have written my code in MATLAB.
INFO:
LipidData is a 68x2 table that contains a name column and the Short ...
-1
votes
1
answer
59
views
Regex for c++ for loop conditions
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.
...
2
votes
1
answer
73
views
error when executing regular expression with python
the file "catalogo_no_linebreak.txt" contains a list of products, grouped in one line, i'am using the regular expression (re.split()) to try
Retrieve the record of each product and logo ...
1
vote
2
answers
2k
views
Unable to group parts of the regex together to make the intended operator precedence explicit
I’m currently facing an issue with a regex that's causing problems in SonarQube, which requires grouping to make the intended operator precedence explicit. After grouping the regex, it’s not working ...
-3
votes
1
answer
110
views
Regex to Ignore parts in a batches of string
I was wondering if its possible to build a regex for this situation. Some context, I am working with patch(diff) files to find the difference between some ASCII file types and I want to match the ...
-2
votes
1
answer
85
views
Regular expression pattern in the string and then also remove the substring [closed]
I have a list of string which contains few set of characters and spaces in the beginning before encountered first three digits.
if the pattern found then I need to collect only first three digits from ...
1
vote
0
answers
18
views
RegEx: final word duplication [duplicate]
I want to trim a string to include 20 words at most using RegEx.
Here's the text I'm trimming:
const text = `Space travel is the ultimate adventure! Imagine soaring past the stars
and exploring new ...
1
vote
1
answer
124
views
Regex : How do I recognize multiple patterns in one expression to gather a string? (UIPATH)
PA Line Item02StatusAPPROVED
COS Code430Category of ServiceNurse
Units Allowed1Amount Allowed$0.00
PA Line Item03StatusAPPROVED
COS Code770Category of ServiceNurse
Units Allowed1Amount Allowed$0.00 ...
0
votes
0
answers
30
views
RegEx for variable-length delimited string in Adobe Classification Rule Builder [duplicate]
I have a string of values with a pipe delimiter. We've recently added two more variables to the end of the string for capturing going forward, so the string will either have 6 or 8 values.
Two example ...
1
vote
0
answers
658
views
RegEx/Power Automate Desktop: Capture all data from specific string to last pattern occurrence?
I'm attempting to use RegEx with Power Automate Desktop to match patterns from a specific string to the last occurring pattern:
Example list:
00_000_A.B.C.\_One_Room
Schrute_Dwight
Halpert_Jim
...
0
votes
0
answers
29
views
How can I avoid returning a non-optional group that is undefined? [duplicate]
I've two possible strings:
TEXT1, TEXT2\n\nTEXT3
TEXT1, TEXT2
Each text should be extracted without the comma and new line characters. I'm able to extract the first one with:
const regex = /^\s*(.*),...
2
votes
2
answers
58
views
Regex match a string that is either seperated entirely by commas or seperated entirely by semicolons
What I'm trying to do is match a string of numbers that has a "consistent" separator between its contents. For example, I want is something that matches the following:
[1,2,3,20,4] &
[5;...
1
vote
1
answer
624
views
Using REG_MATCH and REG_REPLACE function in Informatica to replace a Prefix and suffix of a character
I have a Business requirement in infromatica where we have 2 set of Data's like
'HOUSE ACCOUNT - WELLS FARGO - I' where we
have to remove the suffix ' - I ' and another Data
'JR INSURANCE BROKERAGE ...
2
votes
3
answers
86
views
Regex: Find matches only outside of single quotes
I currently have a regex that selects all occurrences of (, , , );:
(\s\()|(,\s)|(\),)|(\);)
however, I've been trying to figure out a way so that if anything is between single quotes 'like this, for ...
1
vote
2
answers
79
views
Matches the same two digits that were captured in the first group
select *
from bha b
where b.bks similar to '\d{2}[A-Z](\d{2})\d\\1';
The purpose is to regex but bks is in the form
12A56856
12A12812
12A898389
Although I already have this data in my database, the ...
1
vote
0
answers
26
views
Regex - lookahead and between [duplicate]
Suppose I have this structure of strings. I have >100k.
'xxxxxx0AxxZZxxBBxxxxx1AxxxxxBB' --Group1 is 1
'xxxxxxxxx0AxxxxZZxxxxx1AxxxxxBBxxxx' --Group1 is 1
'...
0
votes
1
answer
82
views
Regex to find methods that have an 'inner' method
I'm working on some upkeep for a monolithic java codebase, where it was discovered that some of the @GET methods will actually start a write session, and should thus actually be @POST methods. I wrote ...
0
votes
1
answer
107
views
Why regex pattern is validated in some languages like Java, JavaScript but failed in Python and Regex101?
I have a regex pattern ^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}. It validated in Java and the Browser console but failed in Python. Various online regex testers produced different results. Regex101 displayed ...
-2
votes
1
answer
40
views
regular expression to find pattern in the same word [duplicate]
There is a string "123:987 767687:99 145:986 156:876 "
My regex expression is (\d{3}):\1
I expecting the result is 123:987, 145:986, 156:876
there is no result found. i dont undertsand. ...
6
votes
2
answers
76
views
Ignore string containing
Using PCRE2 regex for PHP script replacement
The purpose of this regex is to add ?? '' to a strlen (PHP) function call if it does not currently exist. I plan to use a regex capture group to perform ...
2
votes
1
answer
30
views
Regex search for pattern and return group
I have a text to search in like this:
process ADT {
{ DOMAINNAME localdomain }
{ EODEFAULT {} }
{ EOXLATE {} }
{ XLATESTARTMODE 0 }
}
process ORU {
{ DOMAINNAME localdomain }
{...
0
votes
1
answer
60
views
Regex pattern matching every url and not filtering
So I have the following urls from an app:
1.${endpoint}/list?currentPage=1&itemsPerPage=20&orderBy=name&orderType=1
2.${endpoint}/list?current=true¤tPage=1&itemsPerPage=20&...