Category "regex"

How to dynamically add escape character for any character in javascript?

I have got p element with some text. In this text in HTML code I use some "escape" characters like \n, \?, \t, etc. When I get the string in JS code, it is trea

Python : Extract mails from the string of filenames

I want to get the mail from the filenames. Here is a set of examples of filenames : string1 = "[email protected]_2022-05-11T11_59_58+00_00.pdf" strin

Extract URL until whitespace or <br> tag using Regex with Javascript

I have a string like: Webcam recording https://www.example.com/?id=456&code=123 or like: Webcam recording https://www.example.com/?id=456&code=123<b

Regex. Get string beetwen two brakets (python)

I'm new in regular expressions and I have some problems with understanding it. Here are some input strings: Coven - GLAM (Lager - IPL (India Pale Lager). ABV 5.

Swift - Getting only AlphaNumeric Characters from String

I'm trying to create an internal function for the String class to get only AlphaNumeric characters and return a string. I'm running into a few errors with how t

How to make regex that matches a number with commas for every three digits?

I am a beginner in Python and in regular expressions and now I try to deal with one exercise, that sound like that: How would you write a regex that matches

How to optimize a regular expression match search in Python

The Program I am building a program that tracks which feature file steps are covered by a step definition. For example, I may have a feature step that is I sho

Renaming namespaces on C# according to the last folder in the file path

I am trying to create a snippet that names a namespace in C# using the name of the last directory in the file path, but it returns everything that comes before

java regex for UUID

I want to parse a String which has UUID in the below format "&lt;urn:uuid:4324e9d5-8d1f-442c-96a4-6146640da7ce&gt;" I have tried it parsing in below

Javascript Regex to match value of JSON key value pair

Given the following key value pairs, how could I match just the values (including the quotes)? Explanation: I'm doing a find and replace in my IDE. I have hund

Match single unknown parameter php (Morse-code Regex)

I have an function that checks if string( parameter) matches values in an array and returns an array of possibilities key function find_possible_match( $criter

Regex for getting region and lang from url /xx/xx in two groups

I have a url structure where the first subdirectory is the region and then the second optional one is the language overide: https://example.com/no/en I'm trying

Regex ignore first x characters and then match pattern

String = '111111111111100000000000000000001100000000000000111111111111111111111111111111111100111111111111100000111100000111111111111100000000000111111111111111

Pad number with variable length zeroes using REGEX

I have a situation where client inputs a number, and I need to validate that number by padding a certain number of zeroes in front of it. The max length of the

regex to remove number (year only) from string

I know the regex that separates two words as following: input: 'WonderWorld' output: 'Wonder World' "WonderWorld".replace(/([A-Z])/g, ' $1'); Now I am l

Is there a general regex method can combine those conditions?

In my code, I use four four regex conditions but it is too long, so is there simple or general method can combine these conditions? I tried to r'[(abc|def)+^((?

search and replace with regex to increment numbers in Visual Studio Code

I'm currently working on a big svg sprite. The diffrent images are always 2000px apart. What I have is: <g transform="translate(0,0)"> <g transform="

Replace text using RegEx in Excel-VBA

I have data in Excel like follows (one row here - one cell in Excel): 07 July 2015 12:02 – 14 July 2015 17:02 12 August 2015 22:02 – 01 September 2

How to compose two calls to Regex::replace_all?

Regex::replace_all has the signature fn (text: &str) -> Cow<str>. How would two calls to this be written, f(g(x)), giving the same signature? Here'

Domain Name Regex Including IDN Characters c#

I want my domain name to not contain more than one consecutive (.), '/' or any other special characters. But it can contain IDN Characters such as Á,