Category "regex"

Lazy Regex before lookahead : not working with `.+?`

I am using VS Code. And I want to select all matches in italics preceding {:term}. Unfortunately VS code doesn't support lookbehind yet, so I am content with th

Python Date cleaner using regex

I've been trying to do a script that takes date inputs like 3/14/2015, 03-14-2015, and 2015/3/14 (using pyperclip to copy and paste) and modifies them to a sing

Spreadsheet RegexReplace but exclude non-number

How to RegexReplace but only for number. I tried this formula, but it didn't go as I expected: =REGEXREPLACE(A2, ":<BR CLASS="""">[0-9]", ": [0-9]") Th

Split string on Upper Case word

I have a string with 2 phrases, separated by an upper case word in the same string: c="Text is here. TEST . More text here also" I want to separate both phrase

Speed up millions of regex replacements in Python 3

I have two lists: a list of about 750K "sentences" (long strings) a list of about 20K "words" that I would like to delete from my 750K sentences So, I have to l

Match timestamps in WebVTT files with sed

I have the following PCRE2 regex that works to match and remove timestamp lines in a .webVTT subtitle file (the default for YouTube): ^[0-9].:[0-9].:[0-9].+$ T

extract data immediately after numeric value in a cell in google sheets

I have cells containing data in google spreadsheet as quantity of some entity and I wish to extract only that string which is after the quantity value (number).

Keyword repeated multiple times in context from string in R

I have a dataset (z) with strings which are very long in z$txt. I also have a dictionary (incd) of keywords that need to be identified. In the column z$inc.term

How can I use Regex to extract all words that written in the camel case

I tried to extract all consecutive capitalized words in a given string written with no spacing in between. E.g. The University Of Sydney => TheUniversityOfSy

Regex for allowing words which have only first letter as uppercase?

I am trying to make a regex which will validate if all the words have their first letter as upper case. ex like Fruits is allowed but fruits is not allowed. als

Converting regex to lucene in Elasticsearch Query DSL

I am trying to convert this regex to work in Kibana in a query search and can't seem to get it to work ((\+[2-9]|[2-9]){1}\d{10,}$)|((\+[2-9]){1}\d{8,}$)|((\+{0

Regex to search for unique last names in XML

I have last names in an XML file that I would like to capture, which are unique. I am going off this other StackOverflow answer to start: Only match unique stri

Regex for double quotes inside string

A follow up to my previous question here. I realize I need to be more specific regarding my regex case to get an answer that works for my case. I am fighting w

How to ensure that a string contains numbers and letters by using RegEx

I'm trying to match strings that either: Contains between 9 and 15 numbers (Only numbers) Contains between 6 and 15 numbers+letters (it must contain both, numbe

Strip multiline python docstrings with regex

I want to strip all python docstrings out of a file using simple search and replace, and the following (extremely) simplistic regex does the job for one line do

replace text between two strings in a file - python

i have a sh file, i need my python script to find specific strings and replace all the text between them in it: hello_example=( # <- this specific line "bla"

How can I validate an email address using a regular expression?

Over the years I have slowly developed a regular expression that validates most email addresses correctly, assuming they don't use an IP address as the server p

Need regex which accept only 4 alpha numeric words and accept period, hyphen and underscore in between

I am trying to write a regex to accept only 4 words and in between the words accept special characters like period(.), hyphen(-) and underscore(). Also if I use

Wildcard/Regex search for [A-Z without Q] in Microsoft Word

Is there an expression for excluding a single character from a character range in the (arguably somewhat peculiar) Regex syntax of Microsoft Word? These don't s

Python regex remove dots from dot separated letters

I would like to remove the dots within a word, such that a.b.c.d becomes abcd, But under some conditions: There should be at least 2 dots within the word, For e