261,134 questions
2
votes
1
answer
43
views
Dataweave how to use variables in regular expression
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}...
0
votes
2
answers
134
views
Is there a way to specify how many times a reference to captured group must be repeated in the replacement string?
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 ...
4
votes
2
answers
77
views
Why do negative lookbehind and optional group allow a match?
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, ...
Advice
1
vote
6
replies
59
views
How to match any amount of Unicode characters (letters, numbers, surrogate pairs) in regex?
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.
-4
votes
0
answers
123
views
Regex VBA macro
I'm having difficulties with the below regex which should find files in directory with a specific pattern. Directory is ok, if else statement files are being printed. But regex.test doesn't match. ...
Best practices
2
votes
4
replies
55
views
How to parse informal Persian number words into an integer currency value (Rial)
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. یک, ...
1
vote
0
answers
90
views
Mongo driver C# is always using global flag for regex
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 ...
-3
votes
0
answers
107
views
Move text in a specific column to the row above and in the same column [closed]
I have extracted the results of "select column A, column B, column C from " in SQL plus to a text file. In the file, a specific column that has long text splits the text into two rows but ...
0
votes
1
answer
112
views
How to parse tab delimited header based on multiple header lines with spaces in R
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 ...
0
votes
2
answers
134
views
How to exclude subtotal lines from result
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 ...
1
vote
4
answers
88
views
SAS prxmatch how to deal with searching for a " within the middle of the expression?
%if %sysfunc(prxmatch(/^\("([A-Za-z])"\)$/, %str(&names))) = 0 and %upcase(&stringC) = N %then %do;
%put ERROR: Please format as such ("obesity","diabetes&...
Advice
2
votes
6
replies
88
views
How to get the expansions from a glob pattern to use in another path
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 ...
0
votes
1
answer
125
views
I can't get this simple pregmatch to work [closed]
I have been trying to figure out how to learn pregmatch and no matter what I try, it never works. I have tried my best until I get a migraine, searched all over the internet, and I hate to ask here ...
Advice
2
votes
6
replies
55
views
Powershell and -replace regex against blank lines '^$'
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 ^$ ...
0
votes
1
answer
136
views
How to avoid "Not a HASH reference at ..." in regex like "qr/^${\CONSTANT}{3,}$/"
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 {...} ...