Category "regex"

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

R: Extract first number despite irregular delimiter from a junk data

I am working on a dataframe df that has thousands of rows of junk data in which the first number is to be extracted despite irregular delimiter: dummy_numbers =

Print REGEX using USER DEFINED FUNCTION

I'm trying to print the variables ccb_3, nome, data, taxa and parcela using the function I defined as "ext_ccb", but when I run the code it returns 3 times (bec

Using regex to get everything in parentheses followed from particular word

I have the following string: text='2-05-13 15:31:48.253 StockSpy Realtime Stocks Quote[5353:207339] Websocket: symbols: ({change = "0.5250015";changePercent = "

Trimming site names

I'm trying to trim any combination of a webname to just web.co. Example 1.htt:pubhorn.co 2.www.pubhorn.co 3.htt://pubhorn.co 4.pubhorn.co/awawa I want to outpu

python replace env params in a string which is not a path

Patterns I can receive can vary and I have used line1 = "$ABC/xyz" line2 = "123_$ABC_xyz" line3 = "abc_$XYZ_123_def_$ABC" line4 = "$XYZ_def_abc" exp = os.path.e

Powershell Regex match statement

Trying to get nxxxxx number as the output from below input, uniqueMember: uid=n039833,ou=people,ou=networks,o=test,c=us uniqueMember: uid=N019560, ou=people, ou

What is regex for square bracket character in javascript [closed]

Can anyone tell me how to make regex for square brackets ( [ ] ) in JavaScript?

How can I extract ISO and ASTM standards from a text using regex?

I would like to extract the ISO and ASTM standards from a text. The corresponding literals ISO and ASTM followed by the numbers would have to be found. Rules: M

How do I remove particular sets of characters and not others?

As a consequence of botched character decoding, I have a set of titles that look like this, with special characters followed by other characters like ñ t

Clean up a comma-separated list by regex

I want to clean up a tag list separated by comma to remove empty tags and extra spaces. I came up with $str='first , second ,, third, ,fourth suffix'; echo pr

Print only non-blank lines in PowerShell

I have a text file with multiple lines. Many are blank, or so I am assuming from looking at the file contents. I would like to write/print only the lines that c

PHP: Check for characters in the Latin script plus spaces and numbers

I am new to regex and I have been going round and round on this problem. PHP: Check alphabetic characters from any latin-based language? gives the brilliant reg

Upgrade Ruby 2.6 to 2.7 - WebMock no longer recognizes RegEx patterns on stub requests

I am upgrading a Rails 6.1.4 application from Ruby 2.6.10 to Ruby 2.7.6. With Ruby 2.7.6, WebMock no longer matches the Regular Expressions that worked perfect

Regex: Extract digits separated by a hyphen

What I have: 123456789-987654321 What I need: 3456789-4321 (keep last 7 digits from 1st group and keep last 4 digits from 2nd group) (\d{7})- gets me

Regex that gets the last set of numbers from a string

"abc_d1.txt" should get 0 "abc_d1_2.txt" should get 2 "abc_d1_14.txt" should get 14 "abc_d12_x2_156.txt" should get 156 This is what I've done so far, but I am

Escaping back-references in recursive search

Is it possible to back-reference the result of an outer :g command in a recursive call (or an inner :s call?) For instance, let's say I want to search for somet

Remove a pattern from a character

I have a character like this: x = "abc [File: abcbdosln}} \n abc \n" And I want to remove File: abcbdosln}} \n from x so that the result would be "abc [ abc \n"