Category "regex"

Java regex repetition not allowed inside lookbehind

I am looking for a way to split a string after every 3rd comma. I have found an old answer from 2013 Split a String at every 3rd comma in Java which I think is

Rewriting url without a speicifc query parameter using regex

I'm trying to rewrite the URL without a specific query string https://example.com?specialVar=xXx1x&para1=xxxx&specialVar=1234&para2=xxxxxx&speci

Replace every sequence of letters with a random word

I created a list of random words: library(OpenRepGrid) list_of_words <- randomWords(100) list_of_words <- gsub("[^A-Za-z ]", "", list_of_words) list_of_wo

How to convert (aa)^* U (bb)^* to regex in python?

I am doing a textbook problem and I am trying to understand how regex works with Python. In python, I tried doing: "(aa)*|(bb)*" I seem to be accepting any stri

Regex for duplicate words in a string with one of them with a apostrophe in Angular

I want to create a regex for a requirement, a string is having duplicate words but in that duplicate words one is with a apostrophe. For example: EXCHANGE CORRE

How to extract only domain country from URL (Data Studio / regex)

I'm struggling with extracting from URL only country for example .pl from https://www.google.pl. At this moment I'm able to extract google.pl from provided url

How to formate or validate date in java like 20992012 or 12122022? [duplicate]

i have to validate date yyyyMMdd or MMddyyyy or ddMMyyyy. if i pass input 20221224, ho to make this is valid? but how can i do this in regex

Apply negative lookbehind to the entire group before it

I want to capture the model of a phone but not the storage in the title. So I don't want the regex to match xxxGB. I am expecting to match: iphone 13 from: "iph

Apply negative lookbehind to the entire group before it

I want to capture the model of a phone but not the storage in the title. So I don't want the regex to match xxxGB. I am expecting to match: iphone 13 from: "iph

VSCode snippet regex for extracting directory and replacing slashes?

I'm struggling to find a VSCode transformation regex that allows me take a string like this:MyProject.Api/Data/RandomPath/Entities/User.ts and produce:MyProject

Chatbot-specific answers

I'm creating a chatbot that asks questions and answers questions, but for now it doesn't have a specific function of answering specific questions that it asks i

Trailing context match EOF flex-lexer

I want to match these two tokens: 1. NUM: A series of characters in [0-9_] with an optional . in between. 2. ID: A series of characters in [a-zA-Z0-9_] with at-

Regex in c++ for maching some patters

I want regex of this. add x2, x1, x0 is a valid instruction; I want to implement this. But bit confused, how to, as I am newbie in using Regex. Can anyone share

Matching number with regex

Need a single combined regex to match the following logic: The number should be 8 digits long, the 8th digit should be the remainder of (the first 7 digits / 7)

Regex to match anything after a delimiter

I have the following case: Time format and some description which is separated by a delimiter - (as like below) 00:00 - Hello element I was using the below rege

Regex Error: A lookbehind assertion has to be fixed width [duplicate]

My pattern works in JavaScript. (?<=(?:username|Email|URL)(?:\s|:))[^\n]+ However, when I try to use it in PHP, I get this error: A lookb

Grep and CMD escaping

I am trying to grep this pattern: ^#include\s+"[^"]+" Unfortunately, when I try the following in a Windows batch file, the pipe (|) and the sort are treated as

Remove "." from digits

I have a string in the following way = "lmn abc 4.0mg 3.50 mg over 12 days. Standing nebs." I want to convert it into : "lmn abc 40mg 350 mg over 12 days. St

Sublime Text 3 - Regex find/replace first captured group with second captured group?

I have two XML files I'm editing using Sublime Text 3. The first file acts as a template, while the second file is based on data export that is a batched XML fi

RegExp constructor adding unexpected comma to pattern

trigoOperators is an array containing some trigonometric operations. The goal is to create a regular expression that parses a string equation into an array. The