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
1answer
32 views

Notepad++ Change case only one letter in a few sentences after a certain symbol

There are all lines of this type: https://aaa/aaa/aaa/2018/06/bbb_bbb-bbb_bbb-bbb-1-bbb.doc It is necessary to change the case of only the first letter in all phrases that are after the last / and ...
0
votes
0answers
23 views

Sort Bullet list alphabetically, maintaining formatting in Notepad++

Hello I am trying to sort lists alphabetically that contain entries separated by • and I need it to maintain formatting. I am using Notepad++ and can also use Python Script (Plugin). Example source: |[...
0
votes
2answers
13 views

Finding anchor HTML elements without href attributes using regex

I'm trying to search through my project for <a> elements that are missing their href attribute, using a regular expression to match the results I'm looking for. I first tried the following ...
0
votes
2answers
39 views

Capitalize everything before a Symbol

I need to find a possibility of capitalize every word BEFORE a symbol. Example: bla apple banana=Bla apple banana Result: Bla Apple Banana=Bla apple banana I want to Capitalize every first letter of ...
0
votes
1answer
20 views

Regex match only URL's that dont contain special characters

I have a list of URL's like so. https://www.website.com/foo https://www.website.com/foo/bar https://www.website.com/foo?query= And I want to have some Regex that only matches with https://www.website....
0
votes
1answer
16 views

a very simple Perl script needed

I have the following text file G.txt. I need a perl command perl -e ... that would extract all negative entries ending with Kč, so that first line it will be -107,60 and last will be -63,00 I have ...
1
vote
2answers
16 views

REGEX: Select the text between certain words, only from the file that contains a certain word

good day. I have to select some text between the words start and finnish in several html files. But, also, I need to select that particular text only if the file contains the word BABY SIN For example:...
1
vote
1answer
46 views

Regex: Delete duplicate double quote (apostrophe) on a html tag (from string)

I have this html tag (from string): <meta name="description" content="I love my mother" but I love my sister" more than I can say"/> As you can see, I have 4 double ...
0
votes
1answer
37 views

Which Regex command to use in Notepad++ to find the desired emails?

I have a lot of txt files in drive D, and drive E. Each file has a lot of different formats. Which Regex ( Notepad++ ) do I need to use, to get the result of email lines with a domain that contains ...
0
votes
1answer
22 views

Notepad++ split function regex

I'm newbie for notepad++. I want to split keyword after @ . user1@yahoo.com user34@gmail.com john@outlook.com My desired output : yahoo.com gmail.com outlook.com
0
votes
0answers
14 views

Regex (ERE) How to exclude some character combination

I'm trying to update nanorc syntax highlighting. I would like to highlight hostnames and separately filenames. I would like to exclude matches if hostname starts with "db." or "nm.&...
1
vote
2answers
23 views

Extract key from key-value pair

I have a file looking like that. mke_version = "3.3.7" msr_version = "2.8.5" mcr_version = "19.03.14" I want to print from file only key ...
0
votes
2answers
38 views

Regex to pull the URL site name from block of text?

I don't know too much about regex, I've mostly just used RegExr to guess & check and come up with suitable expressions for my needs. I've made a notification reader on my phone using Tasker, and ...
2
votes
1answer
66 views

Regex to insert a space between uppercase and lowercase letters

I have text like CacciaMagazineOttobre2020 RumoreFebbraio2021 To add a space between letters and numbers in this way CacciaMagazineOttobre 2020 RumoreFebbraio 2021 I use this regex Find: ([a-z])([0-...
0
votes
1answer
35 views

Where is the date of last change in the XML files of a DOCX?

I've unzipped a DOCX-document and am looking for the date or time for the file's last change. I've tried using command line tools like grep but to no avail. When I upload the DOCX-file to Google Docs, ...
1
vote
1answer
23 views

regex help: Replacing characters

I want to change characters in a json file. I tried some commands but didn't find a solution. Input: { "cpu" : 0.0789131391278358, "disk" : 0, "diskread"...
2
votes
2answers
50 views

MS Word Using RegEx-like Wildcards to Edit Formatting

I'm looking at protein sequence that is highly repetitive and I'm trying to format a specific letter in three-letter motif. For example here's a short snippet of the sequence using the single-letter ...
1
vote
1answer
24 views

Match same string as composed word for first 3 positions of the row

I use this regex to remove similar lines Search pattern: ^(.{5,})(.*)$\R\1.* Replace pattern: $1$2 For example for line like this alfax jack alfax meta regex give me this output line alfax jack I ...
2
votes
2answers
355 views

What is the correct regex for this?

I have a long txt file like this: notes = "asdfasasfs"; name = "Bob Field"; time = "08:00"; address = "123 Apple Road"; phone = "555-1234"; zip = &...
0
votes
1answer
16 views

Extracting specific links from source code in linux command line

I have a 3000 line source code text file of a page. How I can extract specific urls similar to down below and delete rest source code ? https://d17nygptf7ayu.cloudfront.net/photos/0b1983ccf6bb5674f93b....
0
votes
1answer
19 views

How to remove lines if they appear more than once in Notepad++? (removing both lines!)

Here's how my .csv looks : 36;Masashi MOTOYAMA 38;H. SOGAHATA 38;Hitoshi SOGAHATA 47;Masami IHARA 52;S. ONO 52;S. ONO For my project, I need to add one by one every missing id. I want to keep the ids ...
0
votes
3answers
58 views

Can matched patterns be used in a replacement string?

I am new to both regular expressions and GNU sed. I have an anonymised sample of the data below. RED: 13905 16356 17457 18164 18447 21063 26924 27684 30111 30205 CERISE: 6221 6524 18250 24367 24462 ...
2
votes
3answers
74 views

Add extensions to files in a file tree with PowerShell?

I'm trying to add extension to files extension-less in a tree. The following command does not give satisfaction. How to achieve this ? get-childitem * -recurse -exclude *.h | where { ! $_....
0
votes
2answers
42 views

Regex to only keep username:password and delete the rest in Notepad++

I want to only keep username:password combos and delete everything else. The username must include at least two or more characters and the password must contain at least two or more characters. The ...
0
votes
0answers
17 views

Renaming a download file via htaccess

I currently have in a server files in this format https://example.com/files/{group_no}/{date}/{file_no}-file.txt Being: group_no an integer (NN) date format YYYY-MM-DD file_no an integer (NN) ...
1
vote
2answers
108 views

Regex to only keep email:password

I just want to keep the email and password and delete all the other information. Name: Test1 Test1 Address: 11 Test Road Country : Test1 Post Code: abc111 EmailPass : test_111@hotmail.com:password111$£...
0
votes
2answers
47 views

How can I use a regex to keep MAC addresses and delete everything else in a string?

What regular expression would I need to delete everything except for the macs which can include the letters A-F (in capitals) and digits 0-9 I want to delete everything else (letters and numbers) and ...
1
vote
1answer
30 views

Keep the number and delete the rest of the lines using Regex

Please can someone help me with the the regular expression for the following. I just want to keep the telephone number and detele the rest of the lines. Name: Text here DOB: Text here Address: Text ...
1
vote
1answer
21 views

Replace attribute of XML parent node with values from child node

I have an xml file where I want to replace text in a parent node with some text from the child node. This is an example xml: <output name="Element_152"> <field name="NAME&...
0
votes
1answer
30 views

Notepad++ - Copy text between sign

I need please your help : I have this text like this : </span>Seller: sunnybeauty04 (1,702) 98.6%<span </span>Seller: 168tradeworld-au (2,357) 99.1%<span </span>Seller: rna-e-...
0
votes
1answer
33 views

PowerShell: How to substitute array value into regex expression within Where-Object -MATCH

I am having trouble getting a string value from an array to insert into the regex expression in the -match condition of Where-Object below. PS [path]> $ordArr=@("001","005",&...
1
vote
3answers
53 views

Notepad ++ extract MAC addresses from text

How to extract MAC addresses from text to get a list where each line is one MAC adress only? I try to mark MAC addresses with regex, bookmark lines and delete unmarked lines but there is still too ...
0
votes
2answers
40 views

Regex to match an extension

I use this regex [^\/\.]+$ to match .php http://www.demo.com/profiles-forum/linda-blair.php but it match only php. How canI include also dot?
0
votes
1answer
36 views

Regular Expression Notepad++ How do I delete a portion of text in a line without deleting the rest of the line

I have lines of CNC code that look like this: N82 X-.4698 Y4.6023 Z0. C0. B180. N83 X-.4688 Y4.637 Z0. C0. B180. N84 X-.4748 Y4.67 Z0. C0. B180. N85 X-.4876 Y4.7037 Z0. C0. B180. I want to find all ...
1
vote
1answer
21 views

Replacing text case inside the parentheses

For example I have the files with the following names: Apple (Fruit).txt Palm (Tree).txt How can I transform their names to Apple (fruit).txt Palm (tree).txt with RegExp using Bulk Rename Utility? ...
0
votes
1answer
23 views

Notepad++ regex formula

I'm newbie for notepad++. I want to beginning and end of the word of OU keyword. user01,OU=IT,DC=contoso,DC=local user02,OU=Security,DC=contoso,DC=local user03,OU=TEST,OU=HW,OU=IT,DC=contoso,DC=local ...
0
votes
0answers
21 views

What is the regex to find and move

Can this be done using Regex, please? Actual text Patient Name: Second, First Next dictation is on John Doe. He comes in today ... Formatted Text Patient Name: Doe, John He comes in today ...
0
votes
1answer
32 views

Regex: Select everything (the whole line) to the dot but not more dots

I have this 2 cases: 1. I love you. 2. I love you... I want to select with regex only the first line to the dot, but not the second that has more dots. I made this regex, but is not to good: ^(.+?\.)...
1
vote
1answer
45 views

Microsoft wild cards - find words with different endings but next to each other

Aim Hi folks, I am building an Index and I am trying to search for two-word phrases but with declinations in MS Word. So what I want to find is two words next to each other with fixed beginnings but ...
0
votes
0answers
35 views

What is the correct syntax of a list involving regular expressions (non-typical usage in a browser extension)?

So, I'm struggling with configuring options in Aria2 Download Manager Integration extension for Firefox. In the 'Include file type' field I'm supposed to list a number of file types to be captured by ...
0
votes
1answer
55 views

Regex pattern works in powershell but not in notepad++

I use the following line in powershell, which finds what I am looking for. Select-String -Path *.txt -Pattern '(.*)pov\"(.*)Fred(.*)\"$' but I cannot get the find command in notepad++ to ...
0
votes
1answer
30 views

(short form to) Ignore multiple filename patterns using “find”?

It seems I can ignore a certain filename pattern (*.dll) on find search by doing find ! -name '*.dll' And ignore multiple patterns by doing $ find . ! -name '*.h' ! -name '*.cpp' ! -name '*.dll' Is ...
1
vote
2answers
31 views

Notepad ++ Change last name from Upper case to Proper case

Hi I would like to replace all the "last name" instances in my text file from full upper case to Proper case. DOE to Doe or IPSUM to Ipsum as you can see below Name = John DOE Random info 1 ...
1
vote
1answer
29 views

Regex to match date range as (XXXX–XXXX) or (X) (XXXX–XXXX), brackets included

I have this regex $title = preg_replace('/[\"\*\/\:\<\>\?\|]+/', '', html_entity_decode($title[1], ENT_QUOTES, "utf-8")); in details only this part is relevant '/[\"\*\/\:\&...
0
votes
0answers
15 views

RegExes not recognized in SQLiteBrowser

I'm running sqlitebrowser ("DB Browser") 3.11.2 on MX Linux 19.3. The version of sqlitebrowser should handle Regexes - it has since 3.6, IIRC. I've also installed the sqlite pcre extensions, ...
0
votes
1answer
22 views

How to replace or look for italic text within quotation marks

As a text editor, I often come across cases where the author has double marked quotations by putting them in between quotation marks and in italics. In almost all cases it is preferred to use only one ...
0
votes
0answers
23 views

Is there a tool to fix illegal filenames for Windows 10 [duplicate]

Windows 10 has filename rules, which includes illegal characters and too long names for example. You can find all rules in this Microsoft Docs naming a file article. I wanted to make a compact list of ...
0
votes
0answers
18 views

I want to replace a name with special_character name using sed command?

before module name change module \${a ; endmodule after module name change module \${a_ext; endmodule Here, I want to replace any name using sed command , but the issue is when special_character name ...
0
votes
1answer
73 views

Create Fail2ban Rule for Named

As I am trying to create a rule for Fail2ban which seems to me missing for a long while as I being really nerved by in the past I'm also willing to submit it to the world :-) What's been done? ...
1
vote
1answer
232 views

Parse, copy, and inject HTML content between files

I'm trying to to parse HTML content from multiple text files and select specific portions of each file and copy this content to use later to paste into the content of another file. The selected value ...

1
2 3 4 5
35