Category "regex"

Way to match *all* newline-type character sequences in a text file

I'm looking for a way to obtain all sequences of newline-like characters found in a string. I'm trying to use preg_match() as follows: preg_match('/^[^\r\n]*(?

javascript regex to match a combination of and/or expression

I want to match a combination of and/or expression and match only sentences in between for example test1 test2 and test2 or test4 test5 I want to get matches t

How to get the domain and string to the first slash

For example like this url = https://example.com/test/myname/myname.jpg result = re.search('(?:https?://)?(?P<host>.*?)(?:[:#?/@]|$)', url) I can get th

How to filter by Regex in LibreOffice?

I've got this string: {"success":true,"lowest_price":"1,49€","volume":"1,132","median_price":"1,49€"} Now I want the value for median_price being dis

python regix how to split two word and add comma? [closed]

This is my string: Hair ReplacementHair BraidingHair Supplies & Accessories my expected result should be: Hair Replacement,Hair Braiding,

split string until a 5-7 digit number is found in python

I have strings like the following: 1338516 -...pair - 5pk 1409093 -...re Wax 3Pk 1409085 -...dtnr - 5pk 1415090 -...accessories 490663 - 3 pack 1490739 -...2 -

How to write regex to identify different date patterns of a String in android?

I receive different date patterns in APIs. Is there any way to identify the date pattern of the string received in an API so that I can format them without thro

How do I make a more concise extraction from a character vector in R?

We use google calendar for reservations of several machines, and I am making graphs of the usage. I have a line to extract the titles of the calendars for plot

Set a new value after using regex

I have a string that is equal to stringnum. stringnum = "0007001369920090687073" I need to use regex to grab the first 9 digits after the first 3 zeros. I am u

Findall vs search for overwriting groups in Python

I found topic Capturing group with findall? but unfortunately it is more basic and covers only groups that do not overwrite themselves. Please let's take a loo

Problem with regex (check string for certain repetitions)

I would like to check whether in a text there are a) three consonants in a row or b) four identical letters in a row. Can someone please help me with the regula

Powershell batch renaming files with index

for a personal project I want to prefix folder and file names with an index. The goal is to have every childitem name remain the same except for the prefix. My

Why I am getting "unbalanced parenthesis" error in flex

I was testing something with lexer, and wrote this regex rule:[0-9([a-b])[c-f]] ; According this docs, this is equivalent to:[0-9a-f()] ; For example, the foll

How to pluck the second value in a url after the first slash, in a string that could have many slashes?

I know there are countless regex questions out there, but I was unable to find one that fits my situation. Suppose I have the following pathname: /u/some_user/c

extract a string before certain punctuation regex

How to extract words before the first punctuation | in presto SQL? Table +----+------------------------------------+ | id | title |

Remove pattern that occurs outside of words

I am trying to remove pattern 'SO' from the end of a character vector. The issue I run into with the below code is that it will remove any sequence of 'SO' case

How to format a text field javafx

I would like to be able to enter the time in a javafx text field in the format hh:mm:ss. How would I go about formatting the text field? I already got the regex

How to format a text field javafx

I would like to be able to enter the time in a javafx text field in the format hh:mm:ss. How would I go about formatting the text field? I already got the regex

Nginx regex location not matching

I am serving some services on an Ubuntu VM using Nginx 1.14.0. In my server definition, I'm including a location block designed to forward requests from /api/v{

Nginx regex location not matching

I am serving some services on an Ubuntu VM using Nginx 1.14.0. In my server definition, I'm including a location block designed to forward requests from /api/v{