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

Quick file search for text

I was forced to use Visual Studio and wave off my favourite Notepad++. Now after coming back to Notepad++ I can see how slow it searches for fiels, where Visual Studio had "Solutions" where files ...
0
votes
2answers
115 views

Find and replace with sed, keep original line too

I have param1='123' I would like param1='123' param2=123 where 123 will change between the files I'd like to run this on. I can get param2 using sed -i "s/param1=\([0-9]\+\)/param2='\1'/g" ...
-1
votes
1answer
79 views

How to get Improved Hacker News Greasemonkey script to filter content

I'm trying to use a script that runs with Greasemonkey on Firefox (17.0.1, on Windows XP) called "Improved Hacker News", which is supposed to improve the experience of reading Hacker News. There is a ...
0
votes
1answer
303 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 ...
1
vote
2answers
290 views

Notepad++ Regex Help in cleaning up file

I've got a csv file (the column separator is "<;>" ,the text delimiter is the double quote and the row separator "crlf") of more than 18000 lines. However,many of the data contained within the ...
0
votes
2answers
40 views

Regex: match a pattern, change a part of it

If you have a text file and want to search and replace a part of a matched pattern, how would you do it with perl one-liners, sed or python? For example: "653433,78" match with [0-9]{6},[0-9]{2}. ...
2
votes
2answers
42 views

Grep with ERE doesn't filter lines with -v option

I'm trying to use the extended regex option in grep to filter out from files, lines that have the following format of string at the beginning of the line. any-non-space-char: * I'd assumed ...
2
votes
2answers
1k views

How to replace a specific character between specific words?

Would you be able to help me in finding out how I can use the Notepad++ Find/Replace function to replace a specific character between specific words. Please see the example below, I would like to find ...
2
votes
3answers
195 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 ...
2
votes
3answers
119 views

Regular Expression for Find and Replace in Microsoft Word

I want to remove leading and trailing tags from country names. In my example those tags are <li> and <a>. <li><a ...
0
votes
1answer
52 views

How I can delete the lines that contain “ + ”?

I want to delete the lines which containing + . I tried some codes but my effort wasn't successful. Before: DET NOUN . PRON CONJ NOUN ADP PRON VERB PRT VERB ADP NOUN . DET VERB VERB . ADP CONJ ...
4
votes
1answer
270 views

Simplest setup on Windows to send HTTP request, get and apply regex to response, and write match(es) to output file

I'd like to write a script that records the size of the close votes review queue on SO (currently ~95.5k), polling just a few times an hour, so I could plot a general trend. I know what I'm going to ...
0
votes
2answers
56 views

Including " in a regular expression using sed on windows

I have: echo finally came. 34^"This is the account of | sed "s:[1-9][0-9]["]:<a name=\"top\">&</a>:g" and I need to get finally came. <a name="top">34"</a>This is the ...
0
votes
1answer
52 views

How to join strings in the lines that ended with special string?

I have a text in this format: NP00000 Fp NP00000 Fp NP00000 Fp NP00000 Fc NCMS000 AQ0MS0 Fp NP00000 Fc NCMS000 ...
0
votes
3answers
29 views

Almost-flattening a directory structure

I have a bunch of directories in a structure like this: -Music -Artist1 -Album1 -Album2 -Artist2 -Album1 -Album3 -Artist3 -Album2 -Album4 All the directories will ...
0
votes
2answers
60 views

Extract number with regex

I have this string: > HTTP/1.1 200 OK Date: Tue, 12 Nov 2013 15:26:17 GMT Server: > Apache/2.2.3 (CentOS) Last-Modified: Fri, 08 Nov 2013 21:34:50 GMT > ETag: "452//path/to/file" > ...
2
votes
1answer
35 views

make \w match characters like ÄÖÜäöüß?

Is it possible to customize the behavior of regex metacharacters for character classes like that? (In Sublime, or more generally.)
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.
0
votes
1answer
66 views

Word Find - find any highlighted text that starts with a squared bracket

Is there a way to Find highlighted text that ONLY begins with a open square bracket? I've tried using the square bracket as a wildcard, but it won't find any adjoining words. For example, I have a ...
2
votes
2answers
179 views

Find and Replace one character in the middle in Notepad++

I am trying to find and replace an arrangement of 6 letters\special character\numbers. For example they appear as such in my original code DEVICE_NAME","CB2_02 DEVICE, DEVICE_NAME","CB3_09 DEVICE, ...
1
vote
2answers
206 views

Batch-Renaming Movies using Regex

I've been trying to rename some movie files using regular expressions, but so far I have been only marginally successful. The goal is to parse files like this: ...
1
vote
3answers
132 views

Permanently set `find` regextype

GNU find allows the use of different regex formats via the -regextype option, but as far as I can tell I have to type out -regextype <whatever> every single time which is onerous. If one wants ...
1
vote
1answer
64 views

Is there simple software that could perform proximity searches? [closed]

I am reading through quite a few state statutes and I need to see if there are any instances where two words come together frequently, such as flow meter flow-based meter meter based on the flow ...
0
votes
1answer
48 views

Insert new line before each operator [duplicate]

Suppose I have a line like this: abc + def - vfg * I want my output to be like this: abc def vfg If only a single operator is there, I can replace: \r\n+ with + but how to do it irrespective ...
0
votes
1answer
76 views

Redirect with .htacess - URL with regex to URL

I have a temporary need to redirect some installer files on my web site. The redirects that are working now look something like this: Redirect 302 /installer_1.0.0.zip ...
1
vote
1answer
120 views

replace match to a back reference with a string in sed

I'm trying to come up with a sed script to modify the constructors in a couple hundred php files from php4 style to php5 style. I'm making some progress, but I'm having a problem with getting the back ...
0
votes
1answer
71 views

Replace first instance in Notepad++ using Regex

I'm completely new to RegEx and could really use some help with my dilemma. I have a large text file of IP addresses and corresponding hosts: 157.55.33.47 msnbot-157-55-33-47.search.msn.com ...
2
votes
3answers
98 views

How to sort a file with string lines by the number of a specific symbol in the line?

Say I have a large plaintext file with a string on every line. The string only consists of alphabetical characters, except for underscores _, which divide the strings in syllables. I want to sort ...
-1
votes
1answer
52 views

Using Notepad++ to replace only a part of the text

In a html file I want to replace <div id="pe1" style="display:none"> <div id="pe2" style="display:none"> .... <div id="pe20" style="display:none"> with <div id="pe1" ...
0
votes
1answer
440 views

Add new line after words matching a specific pattern

I'm trying to add a new line before and after a hyphenated word (one or many hyphens) in Notepad++ Input This is a search-and-replace test which I need-help to figure-out</h2> Output This ...
0
votes
1answer
47 views

How do I process this data with a regex in Notepad++?

I have a database dump, looking like this: ;i:23;s:18:"Product Name1";i:24;s:27:"Product Name2";i:25;s:15:"Product Name3"; [...] All I'd like to get in Notepad++ is this: Product ...
0
votes
2answers
200 views

Powershell, automatically add “\” before certain characters

I wrote a script that grabs each line in a .txt file, one line at a time, and before moving on to grab the next line, an action is performed. Let's say this is the text file: [Foo] (Bar) To make it ...
2
votes
2answers
460 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
1answer
64 views

REGEX Replacement Syntax for NOTEPAD++ 6.5

I need to locate strings like R[A-Z][A-Z][0-9] (this syntax works) and replace the first character with 3 which leaving the remaining characters the same. What is the "replace" syntax?
0
votes
1answer
59 views

linux find regex - can I use 'search', instead of match?

the find utility is powerful, but I'd need some additional features. its -regex search treats each filename (or dirname) as a string and applys given regex only at the beginning of name. like ...
0
votes
0answers
26 views

how I change this regex to work in these texts [duplicate]

3 days ago a friend give me a code to keep some sentences and delete other sentences that they were not need in notepad ++. Today My teacher told me that this code don't work for all of sentences and ...
0
votes
0answers
26 views

Looking for a solution to discover common text patterns in multiple strings

I'm looking for a solution where I can examine thousands of strings that share some similarity and have it discover appropriate regex pattern(s) that will give a 100% match on all strings? The catch ...
-2
votes
1answer
179 views

Extract Mobile Numbers from text file Starting with 0300 or 0321. Like 0300-XXXXXXX, 0321-XXXXXXX [closed]

How can I extract only mobile numbers from my text file? Mobile numbers format is 03xx-xxxxxxx. Text is something like this: 1 Mr.Pervaiz Ahmad Latifi Rajput Traders, W/571, Ratta Road, Near ...
-1
votes
1answer
546 views

How to parse USER-AGENT field in http header using regex?

I want to parse some information from the User-Agent: HTTP header. The problem is that I'm getting two User-Agent: HTTP headers in the same HTTP Request: CONNECT www.facebook.com:443 HTTP/1.1 Host: ...
0
votes
1answer
43 views

Application to do regular expression search on all pages linked to some specified html page

I am using a Windows 8 machine and starting with an html page I would like to automatically retrieve the text content from every link on that page that matches a regex. The retrieved content must then ...
1
vote
1answer
146 views

How to “reuse” a regex find and replace in Vim

I have a plain text file with entries as firstAuthorLastName_titleFirstWord_YYYY that I change to firstAuthorLastNameYYYYtitleFirstWord with the following s// command in Vim.^[1] ...
1
vote
0answers
40 views

Script to port specifc data from doc1 (notepad++) to specific place(s) in doc2

I really appreciate your help with a windows script or regex function that ports specific data from doc1 (xml in notepad++) to specific place(s) in doc2 (notepad++). I'm running win8. Thank you in ...
5
votes
1answer
130 views

Non-greedy regular expression to convert command tags

Background Consider the following text: There are three types of font families: serif, sans serif, and teletype. To switch between these families, use <cmd>rm</cmd> for serif, ...
2
votes
2answers
407 views

Bulk Rename Utility

I have been using Bulk Rename utility and I have been having some issues. I have some files named things like 664722.pdf,664762.pdf, and 664722-1.pdf that I need to rename. The problem is I have to ...
0
votes
0answers
22 views

TextWrangler 4.5.3 (3310)

I've got a huge batch of XML that has an element order problem, and instead of writing XSL to correct the import, I wonder if I can reorder the elements within TextWrangler? I need to select the ...
1
vote
2answers
71 views

Filtering input with sed (regex)

I'm having an issue with sed not returning what I expect when using a regex pattern to clean up some output from a mysql query. mysql -uroot -p -e 'SELECT `path` FROM db.media_gallery' | sed -n -r ...
3
votes
1answer
125 views

Saving part of found term when replacing in Notepad++

I want to use Notepad++ to find/replace large chunks of code, but a hefty part of it deals with arrays. How can I put a "variable" in Notepad++'s Find/Replace window so that part of it can be saved ...
4
votes
1answer
78 views

Why does grep need a dot in a regex using '$'?

I though I knew grep, but maybe not. I want to find all lines in a file ending with ':' If I run grep :$ ~/greptester.txt but to my surprise, it gives no results. Sometimes I confuse '^' and ...
0
votes
0answers
40 views

Match the First Occurrence In Text Using Boundaries

I need some help as I have been trying to figure this out all night. I need to match the first occurrence in an article. Something like this... The online marketing game has changed since the ...
2
votes
3answers
211 views

How can I find all files on a folder tree that have a none alpha numeric characters in it

I have taken over from someone else a lot of historic data. However the file names are totaly random and badly formatted IMHO. To start with I want to get a list of all files that contain spaces, or ...