Skip to main content

Questions tagged [regex]

Regular expressions provide a declarative language to match patterns within strings. They are commonly used for string validation, parsing, and transformation. Specify the language (PHP, Python, etc) or tool (grep, VS Code, Google Analytics, etc) that you are using. Do not post questions asking for an explanation of what a symbol means or what a particular regular expression will match.

regex
-1 votes
2 answers
10 views

Oracle regexp_replace entire matching word

Input: ABC DEF GHIJ123A KLM GHIJ456B RST UVW GHIJ789C Ouput: ABC DEF GHIJ000X KLM GHIJ000X RST UVW GHIJ000X So, I want to find all instances of words in the string that start with GHIJ and replace ...
Vani Narayana's user avatar
-4 votes
0 answers
24 views

To make a Letterhead consisting of Company Name, Logo, Address using Python , PDFminer, Regex , Canvas, ReportLab and any other tools

Create a letterhead in pdf format,using python in which we can use pdfminer,extract text ,regex, and any other tools as such.That letterhead should contain name, logo of that company and company ...
Craka's user avatar
  • 43
-2 votes
1 answer
17 views

Regex matching online but not in App Script for MMM-YYYY [duplicate]

This is my Regex Pattern to match Date format MMM-YYYY(Apr-23). I have checked this on Regex101 it works as expected. (\b\d{1,2}\D{0,3})?\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:...
Tpk43's user avatar
  • 377
-1 votes
0 answers
22 views

Is there php redirect function that will be redirect if match referer only? [closed]

I try like following but it doesn’t work in sometimes. <?php $refer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null; if( preg_match("/anysite1/i", $refer) or ...
user2971638's user avatar
-2 votes
0 answers
17 views

add double quote delimiters to a tab separated file in notepad++

I have a tab separated file where I need to add double quote delimiters around the text fields. Not all the text fields start with a letter, some start with numbers. There are also number and date ...
DMC's user avatar
  • 1
1 vote
1 answer
24 views

VBA Backreferencing using Regular Expressions Find and Replace

I want to standardize the formatting of some text within a Word document using VBA and regEx. For example, my document would contain text strings such as "Qty #", "Qty (#)", "...
Carter Roekle's user avatar
0 votes
0 answers
19 views

RegEx - String contains specific verbiage [duplicate]

I am new to RegEx, but I am trying to setup a process that sets a designated 'Role' based on an employee's title. For instance, I have a list of key phrases that point to the user having a role of '...
J J's user avatar
  • 11
-1 votes
1 answer
43 views

Return the sum of all the numbers contained within the string

Instructions: The sumNums function takes a string as an argument. It should return the sum of all the numbers contained within the string. If there are no numbers in the string, sumNums should return ...
Primary Maths Worksheets's user avatar
1 vote
0 answers
18 views

Regex - lookahead and between [duplicate]

Suppose I have this structure of strings. I have >100k. 'xxxxxx0AxxZZxxBBxxxxx1AxxxxxBB' --Group1 is 1 'xxxxxxxxx0AxxxxZZxxxxx1AxxxxxBBxxxx' --Group1 is 1 '...
Henrik Løv's user avatar
-2 votes
0 answers
29 views

How to get all occurrences of a string using regex in R? [duplicate]

Let's say I have a string Str1 -> "[18.01,19.023],[20.0289,20.9273],[32.474742,284.383732]" This is like a set of coordinates of type [x,y] and I want to extract all the "x" and ...
Miguel_s's user avatar
-1 votes
2 answers
77 views

Regex for matching numbers >= 150,000 with spaces included not working as expected

I'm trying to create a regex that matches numbers greater than or equal to 150 000, considering spaces as thousand separators. Here is the regex I tried: ^(150\s*000|1[5-9]\d{2}(\s*\d{3})*|[2-9]\d{2}(\...
Jihane's user avatar
  • 150
5 votes
5 answers
95 views

Capturing all matches of a string value from an array of regex patterns, while prioritizing closest matches

Let's say I have an array of names, along with a regex union of them: match_array = [/Dan/i, /Danny/i, /Daniel/i] match_values = Regexp.union(match_array) I'm using a regex union because the actual ...
lumos's user avatar
  • 211
0 votes
0 answers
55 views

regex expression doesn't match, if i put ? after a group

I want to get some information from html text using Python. This regex expression captures multiple times throughout the text. def regexanje(tekst): re_ime = r'<span class="font_xlarge&...
flasavode's user avatar
-9 votes
0 answers
124 views

regex get everything between first and last double quotes each line [closed]

I want get with regex pattern everything between first and last double quotes in each line text: Example Title --- "Values" Example Title --- "Valu"es" I want get like this: ...
Yavuz Selim Özmen's user avatar
1 vote
1 answer
33 views

How to redirect an url with a specific folder to another, whatever the page?

I tried for hours to redirect in an htaccess every pages of a folder to new url, matching the folder but it seems I definitely do not understand nothing to regex and redirect ! I want to redirect any ...
Tim's user avatar
  • 27

15 30 50 per page
1
2 3 4 5
17362