Quantcast
Channel: Active questions tagged regex - Stack Overflow

Iban regex to find in text

I have a regex to find regex like following:^[a-zA-Z]{2}[0-9]{2}\s?[a-zA-Z0-9]{4}\s?[0-9]{4}\s?[0-9]{3}([a-zA-Z0-9]\s?[a-zA-Z0-9]{0,4}\s?[a-zA-Z0-9]{0,4}\s?[a-zA-Z0-9]{0,4}\s?[a-zA-Z0-9]{0,3})?$This...

View Article



Regex \K escape sequence in Notepad++ does match what I target but can't...

Bug or feature?Example:^(?:[^a-zA-Z\s\(]+)(?: · [^a-zA-Z\s\(]+)*\K[a-zA-Z]+ (?=(?:(?: · [^a-zA-Z\s\(]+[a-zA-Z]+ )* 【 [^ ]+(?: ·[^ ]+)* 】)?\r\n)will match the transliterated parts "shibashiba", "dare"...

View Article

Match a Regex Pattern that doesn't follow the serial arrangement in the pattern

How do i match a string to a regex pattern in javascript, but the string does not have to follow the serial arrangement in the regex Pattern.The regex pattern test against a string containing brackets...

View Article

regular expression for left bracket three digits right bracket i.e. [123] or...

I'm looking for a regular expression that will match 5 character strings like the two strings shown in the title. Here's a sample input string.This is a sentence that doesn't contain any matches of the...

View Article

Regex to Find all Paragraphs, [closed]

I am trying to write a regex to find all paragraphs in a text string.Paragraphs are all Uppercase and start and end with new line \nTHIS IS A PARAGRAPHThis is just textSo is thisANOTHER PARAGRAPHThis...

View Article


Email validation pattern in angular material app [duplicate]

I have email address field in my angular app and i applied email validation on it. It is working on most of the cases but if user enters email in the form test@test then it shows red outlinearound...

View Article

perl regex negative lookahead replacement with wildcard

Updated with real and more complicated task:The problem is to substitute a certain pattern to different result with or without _ndm.The input is a text file with certain line like:/<random...

View Article

NodeJS - Removing a variable from a text file (Replacing with nothing then...

Using the below code, I am storing one-time use tokens in a text file, upon being submitted in a POST, the script checks the file to see if it exists and then I need it to remove it. Currently, I got...

View Article


Regex, match variable but limited number of unknown characters in a bunch of...

You deleted the correct answer.I've been doing research since Windows 95. I looked hard for the answer. Considering the fact you chose the WRONG answer, you wouldn't even know what to look for....

View Article


Gitlab Test Coverage Parsing Branches only

I'm trying to implement a regex that will output the Code Coverage only for Branches after running the dotnet test command by using the Gitlab CITest coverage parsing but I'm a little bit stuck. Regex...

View Article

Parsing COBOL Style Syntax using Regex

I am expending my COBOL like parser to extract the target of a Move statement but not anything is square brackets after the element i.e. It should not match the element [B]. An example of the code I am...

View Article

Match several substitution patterns with a single expression

I know from the R documentation that the gsub function can be programmed to do simultaneous operations like upper/lowercase substitution:gsub("([a-z]*)([A-Z]*)", "\\U\\1\\L\\2", "upper LOWER",...

View Article

Remove everything except specific text from a json string using regex

[ {"startDate": "2024-01-31T11:41:59","endDate": "2024-01-31T23:59:59+00:00","price": "795","currency": "DKK" }, {"startDate": "2024-02-01T00:00:00.000+00:00","endDate": "","price": "495","currency":...

View Article


Excel VBA Regex Code to Trim Leading/Trailing White Space and Blank Lines for...

Can someone think of better Regex Pattern text than what I have created?I have tested all related Regex code I can find on this subject, none of it works with multiple lines that have many blank spaces...

View Article

Create regex for price

I need to replace my input value if count of digits after . more then 2 and replace "," to "." if user input it.For example: user input 6554,43553 input should contain 6554.43I tried create regex, but...

View Article


Regex is working in local machine. But in the production machine, it is not...

Basically, I am trying to remove special character from xml file. I have tried the below code. I have tested with regex tester. It's working fine. In the production machine, it is replacing...

View Article

Image may be NSFW.
Clik here to view.

How does a RE fully match a word that should not be highlighted if there are...

const keywords = [Stop,.............]monaco.languages.register({ id: "mySpecialLanguage" });monaco.languages.setMonarchTokensProvider("mySpecialLanguage", { tokenizer: { root: [...

View Article


Handling backreferences in re.sub when replacement includes numbers [duplicate]

Take the following simple regex replacement:import res = "Python version is: 3.10"pat = r'(is:.*)\d+\.\d+$'version = "3.12"result = re.sub(pat, rf'\1{version}', s)print(result)This fails with:Traceback...

View Article

Powershell regex replace : string is unchanged

I'm trying to regex replace some groups of charactes in powershell using the following pattern:/^(thedir[ ]=[ ]")(.)(:[/\])([a-zA-Z0-9])([/\]?.)$/gmby using this instruction:$fileContent = Get-Content...

View Article

Bash split JSON to blocks and replace string within each block

I have a JSON file with the following content:{"Text %s and %s": "Text2 %s or %s","Here is \"Name %s\" and %s and %s": "Blabla %s and %s or %s"}I need a bash command with use of some awk or sed...

View Article

Image may be NSFW.
Clik here to view.

"The big SQL RegEx": How do I RegEx split a SQL query?

I am working on an overview over all tables and queries in all Access databases in a given folder, and my aim is to split the SQL code behind the queries into columns with RegEx. Thus, I try to build a...

View Article


Check if letter is emoji

I want to check if a letter is a emoji. I've found some similiar questions on so and found this regex: private final String emo_regex =...

View Article


perl conditional regex check

<project name="kernel/lk" path="bootable/bootloader/lk" revision="e48c9314142c2ae93619ccd14aba2bc975165ffd"/><Project name="device/google/contexthub"...

View Article

Perl regular expression to retrieve the first digit

I have a string with the value Validation_File_2_3.45.2017.csv.How do I extract the first digit which is 2 in this case using a regular expression?I have tried the expression ($Filedigit) = ($Filename...

View Article

RegExp match repeated characters

For example I have string: aacbbbqqAs the result I want to have following matches: (aa, c, bbb, qq) I know that I can write something like this: ([a]+)|([b]+)|([c]+)|... But I think i's ugly and...

View Article


i need to parse both the columns using regex but i am not able to. Please advise

Port Vlans in spanning tree forwarding state and not prunedGi1/0/1 2,6,21,25,99,195,197,505,605Gi1/0/6 2,21,25Gi1/0/7 2,21,25Gi2/0/1 2,6,21,25,99,195,197,505,605Gi2/0/6 2,21,25using this...

View Article

Netscaler Regex syntax to return last word

I am trying to extract the last word from a user attribute string.The user attribute is AAA.USER.ATTRIBUTE(7)The attribute value string is e.g. "ord1 ord2 ord3 ord4"If I use the expression...

View Article

Microsoft Intune dynamic group. Using -Match to find devices with two...

I need to create a dynamic group in Microsoft Intune. I'm looking to use the -match operator to locate the devices I'm trying to add. The name must have two dashes, "-". i.e.Mov-800-03 would be...

View Article

Regex lookback mulitple conditions

I have a string that could be as follows (1 possibility):"1/1/2024; 02/01/2024; 2024-10-01" I want to return (from the right side) the last occurrence of multiple possible date formats:mm/dd/yyyy,...

View Article



How to get numbers

myPattern = @"?:[.]?[\d]+(?:[,.]*\d)*";However, I would like to exclude the numbers following the dollar sign ($), and want to exclude numbers in parentheses (){}[].For example:input text...

View Article


Latest Images