All Questions
4,204
questions
-1
votes
2
answers
57
views
Add space after specified data using regular expression in Visual Studio
As we all know, Visual Studio has very powerful text editing functions. Now there are hundreds of thousands of data in my txt file. I made a wrong operation, which caused some problems with the data.
...
-1
votes
1
answer
80
views
Regex Match with the last pattern [duplicate]
Suppose I have a .txt file that needs to split using regex, and. So far, I've managed to split using my Regex Pattern.
This is my .txt file:
HMT940040324
SUBH2002078568
2002078568{1:F01BANK MBI}{2:...
-1
votes
0
answers
29
views
How does C#'s named groups handle embedded groups [duplicate]
I have the following code, (note I am talking about c#/.net here since some of this is subtly different in other variants of regex):
var str = @"abc(?<cg1>.*)def(?<cg2>((?<cg3>[...
1
vote
1
answer
73
views
Regex to capture form values in dotnet
I'm writing a custom model binder that will sometimes have to deal with forms. Those forms may have arrays as values.
I've been using this method
private static async Task HandleFormAsync(...
1
vote
2
answers
116
views
How to check depth of nested parentheses using C# regular expressions?
fraction format : frac{numerator value}{denominator value}
input text : frac{frac{1}{2}}{frac{3}{frac{4}{frac{5}{6}}}}
my pattern : frac\{(?:[^{}]|(?<open>{)|(?<-open>}))*\}\{(?:[^{}]|(?&...
0
votes
2
answers
70
views
How can i update a recurrence rule using Regex
I have a recurrence rule in the format specified by RFC 2445, and I need to update the start date and end date. Here are some examples:
DTSTART:20240422T000000Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=...
0
votes
2
answers
74
views
Regex to remove start and ending parentheses inside non nested tag
I faced a problem trying to extract, through Regex, from the following:
<mrow>(<mn>1000001</mn>)</mrow
the inner <mn>1000001</mn>.
I have resolved it with a work ...
1
vote
2
answers
61
views
How can I split command line text into tokens that might contain spaces?
I am writing a C# console app that mimics a CLI.
Let's assume the only thing this app can do is change directory cd.
Example: once the following command is entered:
> cd some_folder
the the app ...
0
votes
1
answer
26
views
Regular expression requiring one word, avoiding another
I'm analyzing file names using Regex, and I need to find 2 types of files which will be in a specific folder. The naming convention is:
DOCUMENTS/COMPANYID.Name of Disclosure.YYYYMMDD.pdf
DOCUMENTS/...
0
votes
2
answers
45
views
C# Dynamic Regular Expression where comparison string might have predictable variations
Trying to dynamically match a string against a list of strings to find a match, but the input might have slight variations.
The only two variations are " " and "-" (space and ...
1
vote
1
answer
61
views
Regex in .NET to match newlines in multiline string yaml values beginning with a pipe symbol
Quick Summary
I have a small yaml file as an example, which I am parsing with Regex using the .NET flavor.
My goal is to match multiline strings beginning with a | symbol, as seen on line 6 below.
...
0
votes
0
answers
50
views
Stack overflow: DynamicClass with Mapster and Regular Expression
I am not sure what exactly can be calling this but is there anything odd with my cleanText function that is run within a property. Every once in a while we get this stack overflow issue but not sure ...
0
votes
1
answer
117
views
Looking for a regex pattern to match unique words each with exactly 3 unique characters
Given a multiline input (shorten for the sake of simplicity):
abc
aaaa
bcde
acd
abc
abc
xyz
I am thinking of a regex pattern that matches unique words (words that occur just once) each consists of ...
1
vote
1
answer
114
views
Regex function not filtering out unicode characters
I have a string that contains unicode characters that are not needed at all and my Regex is not removing them as expected.
I have tried the code below with the results and expected results shown.
...
1
vote
1
answer
59
views
.NET RegularExpression DataAnnotation Attribure Not Matching Correctly
I can find plenty of information on Regular Expressions for .NET, but not specifically for the RegularExpression attribute. From what I can see, it behaves differently than normal .NET RegEx.
I am ...