Regular expressions provide a declarative language to match patterns within strings. They are commonly used for string validation, parsing, and transformation. Since regular expressions are not fully standardized, all questions with this tag should also include a tag specifying the applicable programming language or tool. NOTE: Asking for HTML, JSON, etc. regexes tends to be met with negative reactions. If there is a parser for it, use that instead.
I have the following string string = DdCcaaBbbB. I want to delete all the combinations of the same letter that are of the following form, being x any letter: xX, Xx.
And I want to delete them one by ...
I only started python recently and have never written any code before. I used a regular expression to match a string in the input file (which was successful) but I am really struggling to find a way ...
I need to capture words separated by tabs as illustrated in the image below.
The expression (.*?)[\t|\n] works well, except for the last line where a line feed is missing. Can anyone suggest a ...
I hate to write this post but i've been working on this for far too long.
We are upgrading a multilingual site and the language module that we are now using handles URL's very differently. We are ...
I have a file like below
I want it to be
I have a set of strings of the form:
Team XYZJohn SMITH / Jane SMITH
TEAM RacersJim SMITH / Jane SMITH
John McMahon RacingBob SMITH / Jane SMITH
and want to split on the joined names to give strings ...
I have a nested schema, and I am trying to populate that in req.body. However, I can only access first layer of the schema, the rest remain empty.
I tried to test with postman:
In the result, the ...
I am trying to prevent matching '+' ...
I am new to regular expression. I have to split a dataframe row into 3 columns based on the pattern using regular expression.
Example row in data frame:
"Sample String(just a / string) 04/04/2014 ...
I need to have a RegEx that finds a \n in the middle of a line as a start point, anything before is random, and replace after 15 digits and 49 alpha on the second line. I need to replace all that by ...
I'm trying to design a RegEx in C# to match 4 digits and 6 characters in a string.
string str = "Hello World! ABCD112233 fsdf sdfsdf 234324 fdsfds 4234 efwedf34ref dfsdf34f34f";
that matches only ...
So I've got some sample html that I am trying to parse and extract data from. This is what the data looks like:
<h1 class = “heading1”>MOVIE TITLE<h1>
I have a input that has to format what's the user typing(actually it is info from his bank account). But the numbers have to be formatted in a certain way:
the first 5 digits must be numbers.
if the ...
I would like to get all products where stripped/lowercase version of name field is equal to stripped/lowercase version of input_product_name parameter in Django. How can I do this?
I'm trying to extract a string after a : or ; and before a ; if the 2nd punctuation is present, then to remove everything after a ; if present. Goal result is a number.
The current code is able to do ...