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)

1
vote
2answers
30 views

Matching a sentence with grep

I'm trying to grep for the full sentence containing a search term. I've tried grep (^.|\.\s).*searchterm.*(\.\s|\n) but it's not working and I'm not sure why. To clarify: I want stdout to print ...
0
votes
2answers
17 views

Basic regex match up to first period

I am trying to match a search term up to a first period using grep So for example, grep-ing through foobar searchterm. hello world. should print foobar search term blah. I save the above to a ...
0
votes
1answer
2k views

Advanced Find in Excel 2013?

For the life of me I can't find or find a way to enable "advanced find" in Excel Pro 2013. I have a fairly simple find/replace that I need to do, just locating all entries contained within parentheses ...
5
votes
5answers
2k views

How can I search the windows registry with regular expressions?

Is there a tool or method with which I can search the windows registry with regular expressions?
2
votes
1answer
18 views

Notepad++ Regex find line pattern but only replace one line

I am new to regex. I want to modify lines in a text file based on a particular pattern. I was able to write an expression to find the pattern but in the group of line that it returns I want to only ...
0
votes
0answers
11 views

Replace numbered paragraphs from one document to another?

I have two documents that are identical, but one is in English, the other in Spanish. I took the first and took care of reformatting it by hand, mostly. Now, rather than going through the lengthy ...
0
votes
3answers
44 views

Unix grep finding file beginning with [pattern]

I would like to find files that begin with a particular pattern i.e. the first line of file should contain the pattern, and then print the first 10 lines of such file, is there a way to do that? Is ...
0
votes
0answers
7 views

Vimperator — Custom ExtendedHit to launch script/program on matching regex

I want to define a custom extendedhint in vimperator that: Matches a regex pattern Feeds that match to a script as such: ~/bin/script regex-match-as-arg Where should I start solving this problem? ...
0
votes
0answers
19 views

regex search compressed password protected files

I have a repository of a few million large text files. I need to regex search them on a regular basis. Because they are large, I use gzip to compress them and zgrep to search them. I have been asked ...
1
vote
1answer
23 views

zsh regex failing, bug or user error?

This regex works (stripping out -search) [~%]for i in foo*-search-aae-status ; do echo $i(:s/-search//) ; done foo1-aae-status foo2-aae-status foo3-aae-status foo4-aae-status foo5-aae-status But ...
0
votes
0answers
14 views

nginx regexp rule to block all urls containing a '.js?foo'?

I'd like nginx to deny all requests to static files followed by ?foo, like /path/to/somestatic.js?foo or /another/path/to/my.css?bar This is a trick that application layer ddos attacks seems to use ...
0
votes
1answer
16 views

How to add regex aliases in Postfix when using MySQL

I need to create regex based catchall aliases in Postfix setup with MySQL. I have found examples of a mysql_virtual_alias_maps_regexp.cf with this query: query = SELECT goto FROM alias WHERE '%s' ...
0
votes
0answers
23 views

Find and replace by a single dot several series of two dots attached to the end of words

I want to replace every series of two dots in a document by a single dot, excluding the cases where there are three dots in a row, i.e., the written ellipsis (...). Yet, the series of two dots always ...
0
votes
1answer
36 views

Notepad++ illegal XML character target search using Regex

Fellow Forum Members, I am using the latest version of NotePad++ and I have done a search for illegal XML symbols such as "&", ">", "<", "©" among 200 separate XML files. I found a couple of ...
2
votes
3answers
5k views

Extract/delete all other text than whats inside quotation marks (“ ”), 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" ...
0
votes
0answers
14 views

Moving line with regex notepad ++ [duplicate]

I want to move line down to up with regex notepad ++ or batch script windows example : Video.asp?ZoneID=791 Video.asp?ZoneID=792 Video.asp?ZoneID=793 Video.asp?ZoneID=794 Video.asp?ZoneID=795 ...
1
vote
1answer
21 views

Failed to remove extra spaces using wildcards in MS Word

I have multiple instances of [word]- [word] in a text, e.g. self- interest instead of self-interest, which is the correct form. I am trying to remove the extraneous space after the stroke using MS ...
-1
votes
2answers
36 views

Find and replace {0,} occurrences in Word

Are there any alternatives to the concept {0,} which is not allowed in MS Word? For example, if I wanted to replace, by a single abbreviation, the next five terms: articul articulo articula ...
-1
votes
0answers
29 views

Download web pages and extract contents through regex?

I'd like to download some web pages, extract some of their contents on the fly through a regex and save those into files. The utility should be command-line-based. Some pseudo-code: wget.exe -i ...
1
vote
2answers
187 views

Microsoft Word 2010 regex replace

I am having a problem with a regex find and replace in Word 2010 (Windows 7). I want to convert reference citation numbers in parentheses to the same numbers in brackets. For example, (20-23) should ...
2
votes
1answer
975 views

Matching character ranges and paragraph breaks in Find in Microsoft Word

I have several Word documents where line breaks (paragraph breaks) have been added purely for cosmetic reasons (probably by a human, but maybe by an OCR system or something similar). I want to remove ...
0
votes
2answers
33 views

search and replace in VI

I need to convert '12.22.54' to '12:22:54' in a string below so that it works in MS SQL. cast('14-JAN-14 06.65.22 AM' as datetime),'63.124.79.253'); cast('14-JAN-14 12.22.36 AM' as ...
1
vote
2answers
650 views

Using MS Word as a code editor

As this is an editor question.. this has high risk of becoming a flame war. Please, if you're compelled say "real programmers use Vim" or Emacs or whatever, turn away now. 60% of the time I "write" ...
0
votes
1answer
32 views

Using ' (' (space followed by parenthesis) as field separator in awk

In an awk script I am trying to use ' (' as the field separator. However unless I escape the bracket with double back-slash, like this: BEGIN {FS=" \\("} it does not work. If I use FS=" \(" I get ...
2
votes
3answers
502 views

matching start of the line in cygwin regexp

I apply sed 's/^ bug*/__/' to ref bug bug ref and get ref __ __ ref The same is responded for perl, perl -ni -e 's/^ bug/__/; print'. Sample file can be downloaded ...
0
votes
1answer
21 views

Regex excluding [about:] pages in firefox

I'm trying to get stylish style sheet to be deactivated on about: pages. I believe the regular expression below should be able to do just that, but firefox seems to be of a different opinion. Could ...
0
votes
0answers
18 views

Adobe Brackets: How to find and replace using Regex?

I have installed the latest version of adobe brackets on my Dell laptop. Before this I was using notepad++ and there are many features in notepad++ that I'm trying to load in brackets via extenaions ...
2
votes
2answers
42 views

Rename files based on folder name

I have lots of index.html files in unique named folders (one per folder). I wish to rename each file with that of it's parent folder name. From: /folder1/index.html /folder2/index.html ...
0
votes
1answer
19 views

How to specify a replacement string with a newline in it?

I am using Source Insight. I am trying to replace the string Tmem::Set with the following string that includes a newline in it. //here memset I set the replacement string to be the regex [//here ...
-1
votes
2answers
44 views

Delete text before “=” sign in Notepad++

How to delete a text before "=" in notepad ++. Example 'abc = def' '123 = 456' Output Should be 'def' '456' Thanks
1
vote
2answers
67 views

Best way to increment numbers in one line in Linux [closed]

I have one line with lot of entries among which is also time. ('DEFAULT',17,NULL,'2014-07-14 10:30:00','Something','2014-07-14 06:30:00',1),('DEFAULT',26,NULL,'2014-07-14 ...
0
votes
1answer
18 views

Line Manipulation Reformat text Notepad++ or PSPaD

I have about 40,000 lines I need to look like first line - no paragraph marks. The trouble is, I can't use join lines then use (\d\D+)& $1\n to get like line 1 because of numbers inside of ...
2
votes
2answers
51 views

Treat part of a Regex expression as non-special characters

Let's say I've got a regex expression utilizing some of the special chars, but also a portion with 'normal' text that just happens to have some symbols in. Let's also say I'm too lazy to start ...
0
votes
1answer
37 views

Matching () with a Unix/Linux regex

I have a couple files with the name (a).1 (a).2 ... (a).100 Since a lot of processing tools don't really like ( and ) in the filename I thought it best to rename them to a different name. I googled ...
0
votes
0answers
31 views

Notepad++ extract links from html tag with class

I have a text which consists of different html elements and links like this one: <a href="somelink" class="details btn secondary large">. I want to extract links from a href tag. What are ...
2
votes
2answers
39 views

Regex in LibreOffice Writer - finding “everything” but one thing

I have a text (html code) and need to find <p> tags with their classes, id, styles (if any) etc. I'm doing this using the following regexs: <p(.*?)> or (<p([^>]+))> The pattern ...
11
votes
8answers
9k views

Notepad++ - Removing the first column in a comma separated file

I have a large CSV file that I need to remove the first column of data. I cannot open it in Excel because Excel converts some of the values in the columns to scientific numbers. I am using Notepad++, ...
3
votes
1answer
189 views

Notepad++ - Merge all lines into one and add separator

So this is my situation: I have a lot of lines like this: line1 line2 line3 line4 And they all start with different spaces. What I want to do is merge all the lines in the ...
3
votes
1answer
26 views

Microsoft Word Wildcards to Find Any Dates of a certain form

I am editing a very large document (~200 pages), with multiple dates on each page. I am looking to use MS Word's wildcard function in the find-and-replace feature to remove these. Some examples of ...
0
votes
2answers
37 views

How to construct a regex find/replace in word 2010

I have some limited experience with basic javascript regex, which I've used to manipulate some user data entries. But now, I've been asked about manipulating MS Word 2010 documents. Specifically, my ...
1
vote
3answers
1k views

Fink remove all packages

I switched to HomeBrew from Fink, and I want to uninstall Fink and all of the packages I installed with it to avoid problems in the future. I found this perl snippet that should remove all pacages, ...
11
votes
6answers
46k views

Matching only the first occurrence in a line with Regex

I am completely new to regex and I would greatly appreciate any help. The task is simple. I have a CSV file with records that read like this: 12345,67890,12345,67890 12345,67890,12345,67890 ...
13
votes
4answers
9k views

Newlines in sed on Mac OS X

I find that \n doesn't work in sed under Mac OS X. Specifically, say I want to break the words separated by a single space into lines: # input foo bar I use, echo "foo bar" | sed 's/ /\n/' But ...
0
votes
2answers
314 views

Find repeated words in a text

One of most common typos is to repeat the same word twice, as as here. I need an automatic procedure to remove all the repeated words in a text file. This should not be a strange feature for a modern ...
0
votes
0answers
27 views

OS X Numbers Find and Replace With Variables

I have a massive spreadsheet and a column has a load of HTML in it and i've spotted an error in the code so I need to update it. Each cell with the code in has a bunch of HTML, heres what the error ...
1
vote
1answer
57 views

How do I edit an xmlTV file using sed (or a similar tool)?

I have an xmlTV file that looks like this: <channel id="10125.dvb.guide" <!-- number="62" type="0x1" flags="0xf" bouquet="4097" region="4a" sid="10125" -->> <display-name>ITV ...
0
votes
1answer
22 views

Modify terminal STDOUT/STDERR to change the line colour based on a REGEX

Is this possible? What I would like to achieve is when running unit tests (Python) to highlight any line which matches the path to the current project directory and leave other output untouched. ...
2
votes
1answer
75 views

How to search for special characters in Sublime Text 3

I have a few lines starting with the character # and I search for it in SublimeText 3, but ST3 said unable to find \b#\b. I then tried to search \# and it also fails (with regular expression mode ...
0
votes
1answer
56 views

BASH : grep count same word occurrence

Is it possible to count the maximum number of occurrences of a word in a string using only grep ? Here is an example of what I want : script.sh "aaaa bbbb ccc bbbb azesd bbbb" would return bbbb ...
4
votes
2answers
2k views

Can Outlook Search use Regular Expressions (or wild cards)?

I'd like to search my Outlook email with regular expressions. Is this possible? If not, is there any sort of non-regex wildcard functionality? Without any sort of plug-in is preferable, but if not, ...