Questions tagged [regex]

Also known as regular expression or regexp, a description of a set of strings, often used for searching and validating strings.

Filter by
Sorted by
Tagged with
0 votes
1 answer
12 views

Extract only specific fields from csv file in NotePad++

I'm trying to filter a csv file. The format is in the following order 1,2017-06-27,"The Greatest View","Flume Feat. Isabella Manfredi",https://www.shazam.com/it/track/99802230/the-...
user avatar
  • 3
1 vote
1 answer
31 views

Extract text using RegEx without VBA

I have the following text, and I'd like to pull the PO number. Sometimes it starts with the words PO, sometimes it doesn't. If it doesn't, then PO number will start with either 901 or 902. PO or PO ...
user avatar
  • 13
0 votes
1 answer
23 views

Sed Regular expression to extract MAC address from file

I would like to know what are changes I need to make to my regular expression to work with 'sed' in Linux (actually, I am working with (GNU sed v4.8) in OpenWRT). I have a file containing a list of ...
user avatar
0 votes
1 answer
22 views

Regex for capture lines starting with numbers

In Ubuntu, take the file /etc/passwd as an example. I'm trying to capture the lines 41-46 through a regex. I'm using this command: nl /etc/passwd | grep 4[1-6] The output is this: 17 ******41:41*****...
user avatar
  • 1
0 votes
0 answers
26 views

In Linux: how to choose the proper regex engine to search non-greedy, not hang on the left-most match? [closed]

I had begun to search in my bash_history for a previous command line. I thought it would be an usual, easy task. But it turned to be a non-ending googling without result. My command line I am ...
user avatar
0 votes
0 answers
32 views

Awk regex: how to remove all punctuation except when in the middle of a word?

Following information gathered on this thread, I wanted to use this code to fill my needs, however the code provided wasn't working for more than one punctuation character (e.g. '...'). I thus wanted ...
user avatar
0 votes
1 answer
18 views

Filtering input (numbers only) from a text with regex

I'm trying to figure out regex and using regexr.com to clean up a long list of GPS addresses. The file is formatted a bit like this; </extensions> </wpt> <wpt lat="44.9883638" ...
user avatar
  • 113
0 votes
1 answer
24 views

Notepad++ find multiple matches on the same line and only return extracts from those matches

Posting a revision of this question which was initially answered by @mashuptwice (see Notepad++ : How to find multiple instances of a string on the same line and replace the entire line with found ...
user avatar
0 votes
0 answers
14 views

How to exclude all terms except one word in title when searching YouTube or Google? [migrated]

That is, how to find one-word-titled webpages in Google search results or in YouTube search results. For example, when searching YouTube for the word ‘verb’, I want only videos with the word ‘verb’ as ...
user avatar
7 votes
4 answers
1k views

Find and replace in Notepad++: How to insert above line with same amount of indents?

I need to replace, in a large number of Python files with many function definitions, all occurrences of def some_func(foo, bar): with @jit(parallel=True) def some_func(foo, bar): with whatever level ...
user avatar
3 votes
2 answers
227 views

Replace text inside double quotation marks using Notepad++

I'm trying to replace a lot of lines that would otherwise take so much time. In this case, I need "Test": "Test1" to become: "Test": "Test2" I tried a lot of ...
user avatar
  • 33
0 votes
1 answer
40 views

Notepad++ : How to find multiple instances of a string on the same line and replace the entire line with found strings

For example: Suzy sells sea shells for USD$55 and USD$65 and USD$20 Dave sells all kinds of junk for USD$30 Philip sells CDs for USD$40 and USD$10 Output needs to be: 55, 65, 20 30 40, 10 The ...
user avatar
0 votes
0 answers
15 views

Modifiying a string in an HTML file then renaming it several times from an array list

How can I find a string in an HTML file whenever it is used and replace it (similar to ctrl + h = replace), then rename this file with the same string modified by creating new copy of the initial file,...
user avatar
0 votes
0 answers
17 views

How to get links of another workbook using Regex in MS Excel?

I have a bill folder containing all the bills, named as Bill No. Customer name , if bill no is 36 and customer name is Star Enterprise , Bill is named as 36 Star Enterprise. I want to access ...
user avatar
0 votes
0 answers
28 views

Want to remove duplicate key value using regex

I have logs like in this format and wanted a unique key value by using regex. { url_path:"/v1/test/user", transaction_id:"ABCD-EFGH-IJKLM", }, { url_path:"/v1/test/user",...
user avatar
1 vote
1 answer
26 views

Transportrule -> Text Pattern Regex to capture domain and subdomain

I'm running an On-Premise Exchange 2010 with the following Transportrule checking for Text Pattern on Sender Address: ^.+@(?=.*microsoft)(?=.*.com).*$ Above Regex gets captured if "microsoft&...
user avatar
0 votes
1 answer
29 views

Notepad++ How to copy text, so I can paste into Find/Replace

The first line of my files is a single word (of varying lengths). I wish to copy that word (and delete it), then paste it at the start of all the other lines in the file. I can do the pasting part!, ...
user avatar
0 votes
0 answers
26 views

Strip all following MediaWiki syntax from text

I use Visual Studio Code. I am migrating my website from one content management system to another (from MediaWiki to Drupal) and all my MediaWiki articles are infused with MediaWiki syntax, unfit for ...
user avatar
  • 21
1 vote
1 answer
22 views

I need the proper formatting for a regex find for this -aword-

This is my first time writing code, so give me a break. It is a project I conceived of, I am doing for humanity. And could use a little help! It will assemble clips, combine clips into videos, with ...
user avatar
0 votes
1 answer
24 views

Find mutiple special character in Notepad++

I have to found in multiple Logfiles entrys in logfiles. The returm musst include the following () () so like in line with Weber Tom (PRD) (PRD); but not Huser Andri (PRD) ----Log File---- DEBUG - [...
user avatar
  • 1
0 votes
1 answer
21 views

How I can make Greenshot pattern start from 1 to 9999999?

I recently started using Greenshot and it's a fantastic program for Capture, but I have problem with ${NUM} pattern. It starts like this: 000001,000002,etc.,... How I can make it start like this: 1,...
user avatar
  • 1
0 votes
1 answer
24 views

MS Word how to remove the "-" splitting a word to justify a paragraph?

I want to remove the "-" splitting a word to justify a paragraph. I tried to use the following replace But when applying it I get -> instead example he want to gener- ate the idea ...
user avatar
  • 125
1 vote
1 answer
26 views

How do I remove duplicates that have a difference of one word?

I have a folder with thousands of zip files, many of which are the same but for different countries. E.g. I would have three files called: File 1 (USA) File 1 (World) File 1 (Europe) How can I make ...
user avatar
1 vote
1 answer
47 views

Removing the dash from both ends of a pattern using Regex

I want to remove the dash from both ends of a pattern -L-07-TV-04-Clip-01- using Regex. -L-07-TV-04-Clip-01- -I-have-to-realize- -me-having-this-addiction- -END-OF-CLIP- -L-07-TV-04-Clip-02- ...
user avatar
0 votes
0 answers
25 views

How to print a string in regex from a JSON file for strings that have multiple decimals?

I have a bunch of strings in a JSON file trying to separate them by how many decimals they have. For example: one string is "NEW 5.1" and another is "NEW 5.1.1" How do I ...
user avatar
  • 1
0 votes
1 answer
41 views

Regex to delete text before Email Address

This is what I have: FirstName1 LastName2 name1@email.com ID1 FirstName2 LastName2 name2@email.com ID2 ... and so on. This is what I need: name1@email.com ID1 name2@email.com ID2 ... and so on. As ...
user avatar
0 votes
1 answer
67 views

A regex expression that select a specific character in a given word

Example a regular expression that sélect the character « P » in all occurence of word « PARIS » in a text. Having a text like :" I live in PARIS, my friend lives in PRAGUE. My father is coming to ...
user avatar
  • 1
0 votes
1 answer
39 views

Using FART, how would you search through files matching only a specific known set of file extensions (e.g., .*php|*.html)

Using FART, how would you search only from a known set of file extensions (e.g., like this REGEX .*\.(php|js|html?|css|txt|htaccess)$) without using the *.* catch-all, to process a find-and-replace-...
user avatar
0 votes
2 answers
57 views

sed replace every character in match with single character like █████ redaction

Is there a sed replace function (or other Regex) that will replace every character caught by the match pattern with a single character that is meant to overlay or REDACT the matches? For instance the ...
user avatar
0 votes
2 answers
149 views

Why Dreamweaver regex replace into a wrong character? (-- How to regex replace content specific to (inside) an html tag?)

Situation Here is the Regex & Substitution I used for Regex replace in Dreamweaver:: (( and )|( that )|( include )|( includes )|( including )) $1<br/>\n image: settings for Regex Replace ...
user avatar
  • 105
1 vote
0 answers
42 views

Where is the carriage return character?

I am confused about the carriage return character \r in Windows. As everybody knows, Windows uses CRLF, i.e. \r\n, to terminate lines. So I thought, and tested it out. I opened Visual Studio Code, ...
user avatar
0 votes
1 answer
43 views

Regex: Select and replace empty lines/empty spaces between two strings on paragraph

I have this html paragraph. You see that between starting tag and the text there are some empty lines/empty spaces. I must delete them. <p class="gaga"> Otra característica de este ...
user avatar
  • 750
0 votes
0 answers
13 views

notepad++ regex replace without loosing search criteria

"@Deprecated" code should not be used111 Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used67 Class variable fields should not have public accessibility56 ...
user avatar
0 votes
2 answers
32 views

Find/Replace character in notepad++ using wildcards

I've done some research on this topic, but I've not been able to quite find the exact solution for my particular need. I'm using Notepad++ to write some Z80 assembly code. I need to replace all ...
user avatar
  • 1
-1 votes
2 answers
33 views

regex to find characters in a filename

i have a bunch of filenames (an example is below) and would like to find all files that contain the phrase "_pn". i 'm trying to remove the "-pn" at the end of the filenames by ...
user avatar
  • 121
0 votes
1 answer
29 views

Regex: Add html tags at the lines that doesn't have html tags at the beginning and end of it

I have this paragraph. Also, I have a line I need someone to take me home. that doesn't have html tags. So, I need to find this line (not others) and frame it between tags <!-- START --> <p ...
user avatar
  • 750
0 votes
1 answer
63 views

Using Notepad++ I need a regular expression to find and replace

Today I learned about regular expressions. Today I also learned that I'm terrible at regular expressions! I've been toying around with them and have an understanding of some features but what I ...
user avatar
0 votes
1 answer
33 views

Notepad++ Regex: Replace Text in Line with Capture from the Next Line

I've got some text that looks like this: if ( != null) command.Parameters.AddWithValue("@IsDeleted", acct.IsDeleted); else command.Parameters.AddWithValue("@IsDeleted", ...
user avatar
  • 3
1 vote
2 answers
53 views

Regex: delete all text except 'SS' followed by 4 to 8 characters

I have a long text file that looks like this: Species: Sorbus subcuneata | Somerset Whitebeam Date: 2007-09-30 England OSGR: SS7448 Species: Sorbus subcuneata | Somerset Whitebeam Date: 2007-09-...
user avatar
0 votes
1 answer
222 views

Match all lines which contain string but do not contain other string (with regular expression)

I have this 3 lines, starting with <p class="sd-23">. The second line does not contain the closing tag </p> So, I need to use a regex as to find all lines which contain <p ...
user avatar
-1 votes
1 answer
79 views

How to replace a pattern (return to line not preceded by dot) in MS word

I want to replace all the return to line that is not preceded by a dot in MS word I can do a replace of ^p by space but I want to replace only ^p preceded by a dot (.)
user avatar
  • 125
0 votes
1 answer
193 views

How to find a multiline partial regex match in multiple files?

I have a bunch of files. Every file can contain one or more matches for the following regex pattern: (foo)([\s\S]+)(bar) The matches can contain line breaks / multiple lines. I want to extract all ...
user avatar
  • 1,309
0 votes
1 answer
77 views

Regex first column header csv

What would the regex be for matching the first column header in a csv file? id,field1,field2 1,n/a,n/a 2,n/a,n/a ... I just safely want to match id
user avatar
0 votes
1 answer
59 views

How to remove lines that not containing any uppercase letters or lowercase letters or numbers notepad++ after ":"

I've never used a regex before. I'm looking for a regex command that can help me bookmark lines AFTER ":" that has: at least 1 uppercase letter at least 1 lowercase letter at least 1 number ...
user avatar
0 votes
0 answers
57 views

Regex adding to filename by find replace (Java/ECMA script regex)

I am trying to append to a filename with regex replace.This can be done by many ways for sure but i need to do it with regex, Need select filename and replace it with filename+newtext so in example i ...
user avatar
  • 1
-1 votes
2 answers
45 views

Regex: Add html tag at the beginning of each line (which has no starting tag)

I need to add <p class="mb-40px"> at the beginning of each line that does not have this tag. For example: <p class="mb-40px">moderniseringen av de omgivande ...
user avatar
  • 750
0 votes
2 answers
37 views

Regex: Find and delete html tag which is contained in another tag

I have 2 paragraphs, with html tag <p class="mb-40px"></p> Inside this tag there is text and another <p..> tag I need to find and delete html tag which is contained in main ...
user avatar
  • 750
0 votes
1 answer
20 views

Skip a character from character class

I am using following grep code to search single arabic characters only in Adobe Indesign: \b[\x{0600}-\x{06FF}\x{0750}-\x{077F}]{1}\b All is working fine except that I want to skip just one character ...
user avatar
  • 29
3 votes
1 answer
203 views

How to change syntax highlighting of URLs in Visual Studio Code

One answer is to just turn off linkifying of URLs altogether: "[html]": { "editor.links": false }, But what I'm trying to do is keep that feature and turn off the actual ...
user avatar
  • 963
0 votes
1 answer
25 views

sed remove with regex

I have code that contains #ifdef CEEDLING_TESTS void scheduler_task_delay_update(uint8_t task_index) { #else static void scheduler_task_delay_update(uint8_t task_index) { #endif I want to remove ...
user avatar
  • 101

1
2 3 4 5
39