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)

-4
votes
1answer
41 views

Remove two dots back from end of line

I need to use regex to remove all text starting at the end of line and going back two dots. gtk2-2.24.22-2.fc20.x86_64 becomes gtk2-2.24.22-2 This is the output from rpm -qa to a text file, and ...
0
votes
1answer
25 views

Notepad++ regex - numbers

I tried to search for it and experiment it out, but I couldn't figure it out. In notepad++ I have a line like: 102. or 12 and I would like to delete the whole line (so i would need \n\r I ...
0
votes
1answer
23 views

Notepad++ regex

I have a wall of text (no code, numbers or anything like that). The sentences are sometimes split in the "middle" by a "paragraph" or "manual line break". For example: The most obvious part was a ...
0
votes
1answer
17 views

OS X: Copying only files without a special string in filename

I have to copy only files from a folder that don't have following string in its filename: NNNNxNNNN (a 3 or 4 digit number followed by the character x followed by a 3 or 4 digit number again -> it's ...
1
vote
1answer
15 views

Remove duplicate lines in LibreOffice / OpenOffice Writer

I'm working on a text file in Writer which is basically a sorted list of words and phrases. It contains some duplicates I want to remove. Normally I would use a regular expression in Search & ...
0
votes
1answer
42 views

Microsoft Office 2013: Regular Expressions

I read the articles on RegExp in Office already. My wish is to manipulate quoted strings. I need to replace the quote characters with parentheses. For example: "Hello World." should be replaced as ...
0
votes
0answers
18 views

Bulk Image Downloader not downloading images ending with the multiple of 100

I was using BID to download images off a website. It has a multipage gallery with each page holding 50 images. I added an expression to detect the pages, as the pre loaded ones didn't seem to get ...
3
votes
3answers
40 views

Sed replace only in even numbered lines of a file when replace commands are written in a file

I have all the replace commands in a file (say replace.sed) and i use it with -f flag of sed (sed -f replace.sed InputFile). But now i ran into a condition where i need to apply these replace rules ...
0
votes
2answers
39 views

Is there any way to do a plain text regex find and replace with standard Windows software?

Long story short, I need to enable a client to routinely run a regex find and replace that looks like this on many SVG files that are up to 3mbs in size: Find: font-family=".*?" Replace with: ...
1
vote
1answer
27 views

NotePad++ Get words with REGEX Pattern of Delimiters

I am currently using this REGEX to get whole words with a prefix of PRE_ \b(PRE_)\S* This works fine for most cases, but I would like to handle cases when a special character is part of the word, ...
-2
votes
1answer
42 views

Find a sentence with regex linux

I want a good regex for find a sentence contains words and space in Linux ... I examine several regex but i failed ... i think its very simple but i cant now o it... also im very sleepy..... this is ...
1
vote
1answer
49 views

How do I use wildcards in Notepad++ to 'find and replace' all of this text?

I would really appreciate some help with this. I am working with a large corpus of text that has been marked-up with XML script and I need to tidy some things up. More specifically, there are several ...
4
votes
1answer
45 views

Bash regex to rename set of files

I have to rename a set of files, using the rename command (with a regular expression).  After some tries, I'm not able to find an expression that gets the expected result. I've got a file pattern ...
1
vote
1answer
31 views

Notepad++ Search/Replace Comments { inside } Curly Brackets

is there a way in Notepad++ (whether by Regex or some other way) to replace/remove comments within curly brackets? { some comments { nested comments } need to be deleted } I want to remove the ...
4
votes
2answers
25 views

Rename ':2f' to '-' on folder names in Linux

I've got a hard drive taken from a NAS drive where files had been put on from a Mac - However, some of the filenames had been, for example, 'backup 16/07/14' which has then been changed to 'backup ...
0
votes
2answers
16 views

How to download all file with name emp* using curl from a FTP site

How can I get all files downloaded from a FTP site directory with file name like emp*. Please suggest.
5
votes
2answers
271 views

Checking file names inside a directory with Regular Expressions

I have a list of files inside a directory and I want to make a bash script which uses a regular expression to check if every file name inside it has this syntax: xxxx_xxxx_xx_xx Where x are ...
1
vote
1answer
17 views

Insert a line of text before lines matching a regex in vim

I'm attempting to add a column to an HTML table using vim so I need to add a pair of <td> tags the line before each </tr>. So far I have :186,$s/ <\/tr>/<td><\/td> \n ...
0
votes
1answer
11 views

How to navigate PHP-based pagination with WGET?

I'm trying to come up with a list of possible names for our next baby boy and have been looking through the site IndiaParenting. Each name on the site has a detail page at a URL like this one ...
0
votes
1answer
39 views

Notepad++: How to remove a section of text with regex

I have a file that has lines like: string1,string2,string3 I would like it to just be string2 How would I use regular expression to do this?
0
votes
2answers
35 views

How to search the text for several lines and find in order using regular expression

Trying to figure out the regular expression to be used in Notepad++ where I can search the text below (as an example) and find the results in order. Sample Text: { USERECOVERDB 1 } protocol ...
0
votes
0answers
9 views

mRemoteNG Panel equal to Name

I wanted to have the Panel=%name% or something similar in mRemoteNG. Is it possible to do this within the program? For now I resorted to using Regex find replace in an editor on the confCons.xml file, ...
-2
votes
1answer
22 views

Inserting line before lines containing a particular word

How to insert a line before a line ending with a certain word in textpad? For eg: I want to insert a blank line before every line that ends with the word 'Chapter'
0
votes
1answer
40 views

Using regex to select word before another word which starts with a capital letter

I would like to select all adjectives in a German sentence. As all German nouns are capitalized, I though one way would be to look for capitalized words and select the previous word. If the selected ...
0
votes
1answer
28 views

Weeding out invalid html code with regex

I need a pcre regex that will select all html img tags without a src part. Long story. With help I got to (?-s)<img(?!.*?src).*?\/> which worked fine until a line got a second img tag WITH src ...
7
votes
1answer
118 views

Meaning of \b in .Net Regular Expressions [closed]

Microsoft has a nifty quick reference card for .Net Regular Expressions. But it seems to list \b as both matching Backspace and also matching "On word boundary". Which is it? Can \b really do both? ...
3
votes
2answers
282 views

Grep: count number of matches per line

I'm trying to get the number of matches (in this case occurrences of { or }) in each line of a .tex file. I know that the -o flag returns only the match, but it returns each match on a new line, even ...
0
votes
1answer
37 views

using sed to replace 1 line with a multi-line variable in ksh

I have the following text in a file: XXXX NNNN YYYY NNNN ZZZZ NNNN I want to replace the NNNN to make it look like this: XXXX NNNN DUTY FORECASTER: YYYY NNNN DUTY FORECASTER: ZZZZ NNNN ...
0
votes
3answers
38 views

set chars to uppercase between parenthesis

let's assume in vim I have following lines: all what (strong) people have to do is pushing (heavy) weights over (and over) again in order to gain muscles and I need to convert words inside ...
1
vote
0answers
73 views

Nginx rewrite to remove first (generic) path node

I am currently writing a dispatcher that will dispatch different URLs to specific service URLS. I essentially want to dispatch something like: POST ...
0
votes
2answers
41 views

Change number in last row in data seperated with commas in NotePad++

I have rows of data all separated with commas. How can I replace the last numbers after the last commas with the number 5 in NotePad++? For example: How do I replace 9, 17 and 124 with 5 in the below ...
3
votes
2answers
446 views

How to search a text file for strings between two tokens in Ubuntu terminal and save the output?

How can I search a text file for this pattern in Ubuntu terminal and save the output as a text file? I'm looking for everything between the string "abc" and the string "cde" in a long list of data. ...
2
votes
1answer
91 views

Replace spaces with colon (:) in Notepad++?

Suppose (this is sample data) I have these lines: A W BAKER X CANDLESTICKMAKER Y DOGCATCHER Z I want to change the whitespace ...
3
votes
2answers
42 views

Match cell content based on line break

I take data from a helpline call in site and transfer it to Linux Libreoffice Calc (LC). Column C cells have 2 sets of data - two telephone numbers - 1 being the caller and 1 being the forwarded ...
0
votes
1answer
57 views

How to grep values under columns

How can I grep for a specific column name and display the value underneath that column. Sample data: StandByFile StandByPg StandByLSN StandByRcvBufUsed S0082160.LOG 621668 ...
-1
votes
1answer
21 views

Which regular expressions (POSIX or extended) are allowed in awk?

I'm wondering which kind of regular expressions (POSIX as in grep, or extended in egrep) am I using when type in regular expressions in awk?
0
votes
1answer
40 views

How to use a regex to organize song lists, changing their order from “Song - Artist” to “Artist - Song”?

I have a long list of songs in the format "Artist - Song", but I want them to be listed as "Artist - Song". How to change all items automatically with a regular expression, preferably on Notepad++?
3
votes
1answer
45 views

How do you perform a 2d search in vim?

I'm looking for lines in a file that match a 2-dimensional pattern. For instance, given the following input file: aaaba aabaa aaaba aaaaa aaaaa I'd like to use a pattern like ab ba ab to match ...
0
votes
1answer
31 views

Selective Find & Replace to pretty up my C code in Eclipse or Notepad++

I am working on a old C code which have debug statments like this: debug(1, "SomeDebugStmt %s %d", someString, someNumber); ... debug(2, "another SomeDebugStmt number 2 %s %d", anotherString, ...
3
votes
3answers
244 views

Using vim to delete all lines except those that match an arbitrary set of strings

I use vim to remove all lines except those that match a particular string, e.g. :g!/[string that I want to remain in the editor]/d Works great. But what I really want, and haven't found anywhere, ...
0
votes
0answers
20 views

How to define new scopes using arbitrary delimiters in Sublime Text 2

TL;DR: How do I bring Ruby-like comment scope to plaintext files for sublime text? I want to customize my plaintext file look in ST2 by allowing comments. So far I have managed to extend the ...
1
vote
1answer
53 views

How do I remove HTML from MS Word 2010 document with Find/Replace Wildcards/Regex?

I found a website to help me choose domain names. I have my shortlist which I can't export, but I need to share the list with some other team members first. It also won't let me copy and paste the ...
0
votes
0answers
31 views

Can I apply a regex to file filter on Notepad++?

I have a folder full of xml files, and I want to search through them for a particular ID. However, I only want to search the files that are of the format hello_apple_01.xml, hello_apple_02.xml... ...
1
vote
2answers
99 views

Remove quotation marks around a number (while leaving other quotes)

I want to replace all text like this: "latitude": "32.336533", with this: "latitude": 32.336533, I'm using Notepad++.
0
votes
0answers
28 views

How to identify tab delimited columns in Multitail

I'm trying to remove certain columns from my logs, where columns are delimited by tabs. Here are some ways I've tried to remove the second column which didn't work. multitail -kc " " 2 my.log ...
0
votes
2answers
29 views

Multiple exclusion patterns with grep

I would like to select lines which do not match the specified pattern, where I have multiple patterns to exclude. As an example, I want to exclude lines which start with the keywords apple and banana: ...
0
votes
1answer
39 views

Redirect domain name

I have two domain names pointing to my server. I want them both to serve identical HTML. I thought I would just do the following, however, it was unsuccessful. Note that I eventually will want ssl ...
0
votes
2answers
39 views

Removing Nested LaTeX Tags with Regex

How would I use regex (such as with sed) to remove all \index tags that occur inside any \index tags? For example, a nested mess like this: \index{Test\index{test\index{test}}ing One\index{one} ...
2
votes
1answer
77 views

Use perl to do multi-line replacement [closed]

I have to do some replacements in many *.c files. I want to do the replacement like this: original: printf("This is a string! %d %d\n", 1, 2); result: print_record("This is a string! %d %d", 1, 2); ...
2
votes
1answer
37 views

find -regex not recognizing \d digit

I have a directory structure that looks like the following: processor0/10 processor0/10.1 processor0/10.2 processor1/10 processor1/10.1 processor1/10.2 ...etc... processor7/10 processor7/10.1 ...