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
0answers
6 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 ...
1
vote
1answer
10 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
37 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
21 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, ...
-1
votes
1answer
39 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 ...
21
votes
10answers
17k views

Renaming many files in Mac OS X, batch processing

I used to rename file in Linux via a rename command: rename 's/old_pattern/new_pattern/g' *glob Is there something similar in Mac OS X (Snow Leopard)?
2
votes
1answer
10k views

.htaccess 301 redirect with regular expressions

If I have: redirect 301 /users/foo http://www.example.com/profiles/foo redirect 301 /users/bar http://www.example.com/profiles/bar Can I do something like? redirect 301 ^\/users/(.+)$ ...
1
vote
3answers
2k views

Extract/delete all other text than whats inside “ ”, and after string

I'm have a very big data output in a .txt file that looks like this: value1="1",value2="2",value3="test3",value4="4" value1="1",value2="2",value3="anothertest3",value4="4" ...
4
votes
1answer
42 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
38 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 ...
1
vote
1answer
24 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 ...
0
votes
2answers
2k views

Why escaped single quote doesn't work in grep?

I am trying to match a string: * * * * * /usr/local/bin/growlnotify -t 'helloTitle' -m 'helloMessage' -n 'myApp' -sw with: crontab -l | grep '^[^#].*/usr/local/bin/growlnotify.*\-n \'myApp\'.*$' ...
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
1answer
27 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 ...
5
votes
2answers
264 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 ...
0
votes
2answers
15 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.
1
vote
1answer
15 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
9 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
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 ...
10
votes
6answers
3k views

Removing ANSI color codes from text stream

Examining the output from perl -e 'use Term::ANSIColor; print color "white"; print "ABC\n"; print color "reset";' in a text editor (e.g., vi) shows the following: ^[[37mABC ^[[0m How would one ...
1
vote
4answers
899 views

Batch renaming of files using regular expression in Unix

I have several thousand files of the form: [8-digit number]_[number I want]_S60491_I129111.dcm. I wish to remove everything except the number I want, and use that as its name. In Ruby, I can get to ...
3
votes
1answer
5k views

Is it possible using regular expression in inbox rule criteria

I want to filter all mail whose subject starts with [SomeWord], so I wonder is it possible using regular expression(such as ^\[SomeWord\]) for inbox rule of outlook. I'm using outlook web aceess, not ...
0
votes
1answer
38 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
0answers
8 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
20 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
37 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 ...
3
votes
2answers
252 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 ...
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? ...
0
votes
1answer
432 views

Sed pattern for multiple lines

I want to remove all create table statements from a mysql script, but the statement runs over multiple lines. Like this: Create table ......NEWLINE... NEWLINE... NEWLINE....; So I tried this ...
1
vote
1answer
3k views

Extract substring before = sign using awk

Say I have some file with a bunch of lines in the form someString=someMoreCharacters anotherString.blah=foo=bar blah.blah.blah=foo.bar.=foobar Desired output someString anotherString.blah ...
1
vote
1answer
86 views

How to do concise two alternative substitutions in Windows Excel 2010? [duplicate]

Possible Duplicate: Can you do Regular Expressions in Excel without VBScript? I wish to replace a string pattern with another along the lines of the following: ...
2
votes
1answer
34 views

regex for specific number of numbers

I need to get the regex-pattern for the following sequence of numbers: X.XXX.XXX-X Every X is one number. How can I do that? I don't want to use *, because I need exactly the number of numbers.
2
votes
2answers
450 views

regex : does not begin by “pattern”

I have a lot of lines in my LIST file and want to list only lines whose name does not start by (or contains) "git". So far I have : cat LIST | grep ^[^g] but I would like something like : #not ...
2
votes
2answers
97 views

How to grep a line with a backslash at the end of the line?

I'm trying to grep a line with a backslash at the end of the line like: abc\ def ghij ... I hope it can grep the line "abc\". I tried the command below but they didn't work. grep -EHn "\\$" ...
5
votes
3answers
16k views

How to delete files on the command line with regular expressions?

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, ...
0
votes
1answer
35 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
37 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 ...
3
votes
2answers
405 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. ...
1
vote
2answers
1k views

Perl for matching with regular expressions in Terminal?

I'm trying to familiarize myself a little with Perl to use for regular expression searches in Terminal (Mac). Now, I'm not really looking to learn Perl rigourously, just trying to find out how to do ...
1
vote
0answers
64 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
38 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 ...
1
vote
1answer
90 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 ...
2
votes
3answers
192 views

Word find/replace: add space to postal code with wildcards

Using the “Find and Replace” dialog in Microsoft Word 2003, I want to search a list of addresses for postal codes (Canadian) that do not have a space in them, e.g., M2N3X6 L4C2A9 K5G1S7 and put a ...
3
votes
2answers
41 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
55 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
19 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
39 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
238 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, ...