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

learn more… | top users | synonyms (1)

0
votes
2answers
13 views

How do I print the line only with the last occurrence of a regex?

I have a (large) file that has multiple occurrences of the expression SCF Done and I am (for now) only interested in the last of these lines. Currently I am using a piped command: sed -n '/SCF ...
0
votes
1answer
16 views

Appending (via rename?) `.bad` to files identified by `tests/test_.*`

What do I want? Given the following directory structure: . ├── bar.py ├── hap │   ├── bla.py │   └── tests │   └── test_hap.py └── hip ├── testimony.py └── tests ├── foo.py ...
0
votes
1answer
12 views

Excel: Find&Replace issue

I'm trying to find out, how to replace only those substrings (in my case it is ,_ where _ is a space), which starts at the beginning of the cell. I suppose, the solution should be like this regex: ...
0
votes
0answers
11 views

Multiple character lookup within square brackets with regex [migrated]

I’m using regex in JavaScript for certain text replacements to convert legacy encoded text to unicode (it’s an indic language). Suppose I anywhere I find either of a,b,c followed by either of x,y,z ...
1
vote
1answer
28 views

notepad++ User Defined Language regex

Is there a way to recognize certain text as a keyword Only if it is the first text in the row? I don't see such an option within the 'User Defined Language' -> 'Keywords Lists' options
0
votes
1answer
27 views

How to cp multiple file extensions?

How do I cp multiple file extensions, like png, jpg and tif files? I tried: $cp ./*.(jpg|png|tif) ../output/ >bash: syntax error near unexpected token `(` $cp ./01_reliefs/*.\(jpg\|png\|tif\) ...
0
votes
2answers
14 views

Append to data in an XML attribute using Regex in Notepad++

Newbie alert! I am trying to automatically append some text to the data within an XML attribute - I believe notepad++ will do it but I cant figure out the expression I need to use to search. It ...
1
vote
2answers
51 views

Find and replace notepad++ with wildcards

I've read about 15 tutorials on regular expression however I'm clearly not getting as I've been unable to tailor it to my problem. I have one set of code which would be found in many different ...
1
vote
1answer
42 views

RegEx to Remove All Text Between Set Characters

I'm using the Regex functionality in Notepad++ to delete all characters between specific characters. For example I have text file with the following line: table.column NOT IN ...
1
vote
1answer
18 views

Word wildcards/regex search from the begining of line till the first :

In MS word 2013 I'm having multiple lines like: Duis pulvinar, enim montes : magna tincidunt penatibus nec amet a nec tristique rhoncus aliquet? porttitor diam amet : nascetur sociis dapibus ...
-1
votes
1answer
42 views

Remove of everything between two characters in Word (regex)

I need a regex to remove everything between the "<" and ">" characters. An example would be: <blah blah blah>Something I want <blah blah>really bad<blah blah> becomes Something ...
0
votes
1answer
43 views

Notepad ++ removing text between delimiters

I have some lines of text with this structure: TEXT1:TEXT2:TEXT3 I only need TEXT1:TEXT3 joined together. I want to remove the TEXT2 value. I have tried many options to try sorting them but ...
1
vote
1answer
27 views

How to specify a sed expression to remove non-printing octal characters from a text file

I am new to sed and am cleaning up a very large file. The cleaned document looks right, but when I read it into my R, it shows that each line is appended with \016\t at the end of each line. I have ...
0
votes
2answers
17 views

Notepad++ Joining a line containing a pattern to the previous line

I have a list of data containing table names and table parameters. In some of the cases, there is supplemental data containing the keyword SourceTableName Table:dbo_mlo_city;ODBC;DSN=blah; ...
0
votes
0answers
13 views

how to list all “reports” subdirectories that contains .jsp files?

I really have no idea how to do this on windows with Widnows Explorer. So I am trying to use Cygwin. Basically, I'd like to list the full path of all subdirectories "reports" that contains .jsp files ...
0
votes
2answers
36 views

Notepad++: How to trim strings to a maximum length in a huge file?

community i need your help, please! i want to trim strings in a file with about 900000 lines: KAA BSJDKWLADDKHUEW AJMJJ GMEMJRGUMGA GJWEGRJGJALUSGEUIGRL AGUGADJF WE ..... I Want to trim all ...
0
votes
1answer
33 views

Place string in front of underlined text in Word 2013

I have a bunch of questions with right (underlined) and wrong answers in a list like this: 1. What is love? - baby - don't - hurt - me where only the part with the right ...
2
votes
1answer
32 views

Convert specific word to uppercase

I have a document which have a specific words started with underscore ("_"). I need a regular expression for notepad++ to change it to uppercase. I've tried this one but it doesn't work: _\w+
0
votes
0answers
11 views

Keyboard shortcut to select the first result of a Regex search in Sublime Text 3

I attempt since 2 days now to config a shortcut to search for regex (regular expression) in the code and only select the first occurrence without automatic replacement. It allow me to navigate easily ...
0
votes
1answer
22 views

How to match one or more non-slash characters

I am given a relative path that descends n levels deep and want to produce the "reverse" path that ascends the same number of levels. I want to produce the same number of levels with or without a ...
1
vote
1answer
53 views

Using Regular Expressions with DownThemAll to exclude a file name

I'm using DownThemAll and a bit of regex to grab files from a web page. My DownThemAll filter is set up as follows: /\.(?:pdf|doc|docx|xls|xlsx|ppt|zip)$/i However, each page also includes the file ...
0
votes
0answers
25 views

Notepad++ find procedure/ function declaration

I need to find a procedure declaration in Notepad++. How should I search using regex to find procedure someproc(..) and not the procedure "includes" external procedure someproc(...) i.e., search ...
1
vote
1answer
32 views

regex - repeated capture used in repeated backlinks

I am successfully capturing successive groups that end with a colon, but I don't know how I might have each of those captures to be repeated in the replace, with backlink references. Here is a sample ...
2
votes
2answers
32 views

Use regex to change (reorganise) multiple filenames in Bulk File Renamer

I have a few thousand MP3 files nested in folders which I would like to bulk rename. The files currently have the following naming convention: "tracknumber_artistname_-_songname_MP3COLLECTION.mp3" ...
0
votes
3answers
44 views

regex delete line contain result in office word 2013

I have a document in word. My paragraphs like: asdfasdfasdf abcYear052014 asdfasdfasdf acbYear122013 I want delete line xxxYearyyyy so in notepad++ I put .*[0-9]201[0-9]$ and replace with ...
2
votes
1answer
53 views

Find UTF8 characters with RegEx

I have many files (xml, css, js, html) and would like to see everyone who has "UTF-8" characters, because some files are in ANSI and others in UTF-8 without BOM. I tried several "RegEx" to the ...
0
votes
1answer
39 views

Find questions (words before “?”) Regex Microsoft Word

I have several books that are improperly formatted that contain, among other things QUESTIONS and Answers. My job is to make all the questions CAPITALIZED AND BOLD. I'm using MS Word to maintain the ...
1
vote
4answers
187 views

Select lines that contain anything different from 0.00

I have multiple lines in a notepad++ document and I want to find all the lines that contain something other than "0.00" Ie Timetaken: 2.39 Timetaken: 1.30 Timetaken: 0.75 Timetaken: 0.00 Timetaken: ...
0
votes
1answer
28 views

How can I tell VIFM to filter binary files, “.hi” files and “.o” files?

I've managed to filter ".hi" and ".o" with: :filter '\.(o|hi)$' But how do I filter binary files too?
0
votes
0answers
33 views

Notepad++ function list: Account for jquery listeners in javascript class

Notepad++'s function list works decently well with PHP and Javascript. I am having an issue with DOM listeners breaking my FL structure though. Does anyone know how to solve this? Here's a ...
0
votes
1answer
28 views

Replace a couple of strings of text automatically?

More detailed: I've got a folder with data for a game which code is pure text and customizable (M.U.G.E.N). Beside all other things, the *.cns file of each character contains following string of ...
0
votes
1answer
60 views

Regex for cron pattern not working

Tried to create a (simplified) regex for cron patterns for myself and came up with the following one: ^(((\d+(,\d+)*)|(\d+-\d+)|(\*(\/\d+)?))(\s+(\d+(,\d+)*)|(\d+-\d+)|(\*(\/\d+)?)){4})$ This is ...
0
votes
2answers
30 views

Copy files with extension - search subfolders

Copying ttf files from one folder to another using wildcard "**/*ttf", however this is not searching the files in sub-folders as well. How can I copy all the files (present in sub-folders as well) ...
0
votes
0answers
43 views

Stop regex from searching after hitting the first specific string instead of going to the last one

I have a file that looks like this: <target>randomnumber1 </target> <target>randomnumber2 </target> <target>randomnumber3 </target> I need a regex that will find ...
0
votes
1answer
54 views

Using RegEx to select text

I have some very long strings of text where the first 30 characters are all identical but the following characters are all random except that the last character is always a '>'. How can I use RegEx to ...
1
vote
1answer
21 views

Remove characters before string?

I have a huge CSV with content like so: 9,4300~SEAFOREL (VZ-1000984) 10,050T~KEERLA SWER (VZ-1000985) 11,RI-10~Richmond No.10 33kV (VZ-1000983) 12,366.FC~HUNT (VZ-1001094) I want to get the ...
2
votes
2answers
147 views

Notepad++ - How to remove everything after the last backslash “\” on a line in a text file

I have a list of about 30,000 files (with paths) that need to be individually copied along with their folder structures. Unfortunately, the paths are very long and the file copy utilities that will ...
2
votes
2answers
45 views

How to remove text before link

I want to remove everything before a link in some text. I'm using Notepad++ and have tried several regular expressions but nothing works correctly. What I want: Before 92812/abc.png', ...
1
vote
1answer
19 views

Get user logged into a given tty

I'm writing a bash script that disconnects idle sessions but writes to the tty a few seconds before terminating it to make sure it really is not being used. The format for write is write user [tty]. ...
1
vote
1answer
18 views

Editing gcode with vim regex

I need to edit gcode for a model in particular I have to substract number 87 from all Z coordinates. Here is sample of gcode: ;LAYER:435 G0 F9000 X-38.420 Y-26.887 Z87.300 ;TYPE:WALL-INNER G1 F1800 ...
0
votes
1answer
33 views

Notepad++ RegEx Help Please

I would like to use notepad++ to remove all text after the / in a domain url. I have a huge list of domains and some of them have a specific page or address after the domain name. I want to strip the ...
1
vote
1answer
83 views

Regex append a string to a part of the match

I find this quite hard to do, the thing is as follows: I have a string in the form: GlobalParameters::$docId = DocList::$PARTNERS; And I want to append the string _VIEW to the end of the symbol. ...
1
vote
2answers
35 views

Having trouble replacing a specific hyphen in directories that follow a specific format in Bash

I have a list of directories using the format: 2014-12-03 13-03 2014-09-03 12-07 etc. I need to change them to: 2014-12-03 13:03 2014-09-03 12:07 … I’m trying to do this with for d in *\ ...
1
vote
1answer
39 views

How to delete the 3rd occurrence of a pattern in a file, and beyond

How can I find the third occurrence of a pattern in a file (Note: not in a line) and delete the line containing the pattern and n lines below that (say, 5 lines below). e.g., COVER fafjasfj isfapifj ...
1
vote
1answer
56 views

Amavis - How to blacklist using regex, from an external file

I currently have this line in my amavis user config file: # BLACKLIST read_hash(\%blacklist_sender, '/etc/amavis/blacklist'); It works fine with entries such as: .baddomain.net .spam-galore.net ...
0
votes
1answer
92 views

Notepad++ search and replace with current line number

I am using notepad++ and am using it to create 200 copy commands. Each line starts copy \\server\\folder\a.pdf 1.pdf I want the 1.pdf to be a different file name for each line so I was thinking of ...
0
votes
0answers
18 views

Exclude during search and replace but in Word

This is an extended version of question Is there a way to search for a pattern in MS Word document?. What if there is a number as below? 124/555% 123/3333 1233345/1222% So how can I ...
13
votes
2answers
558 views

Is there a way to search for a pattern in a MS Word document?

Is there a way to look up patterns inside an MS Word document instead of an exact match? I have a document where all decimals have been written as / instead of .. For example, 1.02 has been written ...
0
votes
1answer
33 views

youtube-dl -o cannot insert single backslash in config file (windows)

I have created a file in the %APPDATA%\youtube-dl\config.txt as suggested at from the youtube-dl doc I need to place the output of the file to **D:\Personal\music** but the problem is that I ...
1
vote
0answers
38 views

How can I cloak my Amazon affiliate links in regex format for Wordpress? [closed]

I have many Amazon links, each for different products, on my website and I want a generic redirect link that would point to each of my products. For example I have this link: ...