Category "regex"

How do I deal with special characters like \^$.?*|+()[{ in my regex?

I want to match a regular expression special character, \^$.?*|+()[{. I tried: x <- "a[b" grepl("[", x) ## Error: invalid regular expression '[', reason 'M

Automata - Regular Expression (Union Case)

Automata 1) Recognizes strings with at least 2 a Regular Expression = b*ab*a(a+b)* Automata 2) Recognizes strings with at least 2 b Regular Expression = a*ba*b(

If cell contains a certain text, return a specific drop down list item (Google Sheets)

I've created a quote form, and in one cell (C6:H9) I enter the address with the city name. In another cell (C31:F31), I have a drop down list with different cit

regular expression to match exactly 5 digits

testing= testing.match(/(\d{5})/g); I'm reading a full html into variable. From the variable, want to grab out all numbers with the pattern of exactly 5 digit

Improving the performance of an PCRE Regex Pattern

I have the below regex here which is written to support the PRCE/PRCE2 format. However, this throws the following error “Evaluation takes too long. Please

How to match a word with no special character at front and back

I am trying to match a word which has no special characters attached at both front and back. The regex I have written is /\btest\b/gi

RegExp Match all text parts except given words

I have a text and I need to match all text parts except given words with regexp For example if text is ' Something went wrong and I could not do any

Regex : match ass \fn font tag

I want to match all \fn tags with the following font name, so for : \fnArial\i1 \fnArial \b1\fnArial) \t(\fnJester (BIG)) \t(\fnJester (BIG))\i1 \t(\fnJest

Getting overlapping regex matches in C#

I have the regex 1(0*)1 and the test string 1000010001 I want to have 2 matches, but I find that only 1 gets found : var regex = new Regex("1(0*)1"); var valu

Creating anchors for footnotes in markdown

I help publish articles on history, archeology, toponymy, etc. The texts are scientific and they always have a lot of references to the literature used (anchors

Different Java Regex matching behavior when using UNICODE_CHARACTER_CLASS flag

I was testing the behavior of the Pattern.UNICODE_CHARACTER_CLASS flag for different punctuation characters and noticed that the matches for grave accent charac

How to replace my current regular expression without using negative lookbehind

I have the following regular expression which matches on all double quotes besides those that are escaped: i.e: The regular expression is as follows: ((?<![

Regex match all word pairs

I am trying to get all the word pairs out of a piece of text. I have the following regular expression (\w+) +(\w+) that I run on a piece of text with no punctua

Match string from beginning to end of string

import re text = "A random\string here" test = re.findall('(?<=A ).+\s', text) I want to print out everything from the end of "A" (excluding the space) to

Extract subtring using regex python

Hello I have this string and I need extract from this some sub strings according some delimiters: string = """ 1538 a 123 skua456 789 5 g 15563 blu55g b 456 164

how to extract string inside single quotes using python script

Have a set of string as follows text:u'MUC-EC-099_SC-Memory-01_TC-25' text:u'MUC-EC-099_SC-Memory-01_TC-26' text:u'MUC-EC-099_SC-Memory-01_TC-27' These data

Wordpress query search 's' exact word

I see this question has been posted multiple times but all of the examples I've tried are not working. I want to limit the search by keywords to only search for

How do I build a Regexp that doesn't care about positions

I'm making a Scrabble game with HTML and Javascript and I'd like to add a "hint word" feature based on the player's rack. I have a dictionary array with the val

Regex to filter out Datetime time from string

Requirement: I am receiving an email with a template and I need to filter out some text from the email. I am converting all the email body text as a string. ema

Replace character inside double curly brackets regex

I'm trying to replace - character with _ inside a double curly brackets. Example inputs: Hello {{first-name}}, how are you? The event {{event-name-address}} Exa