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

Find & Replace in notepad++ with regex

I need to convert some old VB.net code to c#, and to speed things up I was planning to use regex. For instance, in this piece of code: if (Request.ServerVariables("SERVER_NAME").StartsWith("user")) ...
1
vote
1answer
25 views

Is it possible to sed -i from a text file to another text file?

I'm coding a shell script on my Debian box and there's a line on the script that needs to delete some emails from a textfile that is full of emails, like this: sed -i ...
-3
votes
1answer
49 views

Does Notepad2 have a multiline mode for regex find/replace?

Completely rewriting this question since I've discovered the tru source of the problem. I have the following text file: strUpdateSql.Append(" this is a string ,") strUpdateSql.Append(" that has ...
0
votes
1answer
41 views

How can I make a NetBeans search for HTML that includes odd white space?

For example, for code with lots of snippets like this: <section> <p><b>test</b></p> </section> I want to be able to search for: <section> ...
0
votes
2answers
1k views

Notepad++: How to remove text after second occurrence of comma using Regex

I've got text lines like string1,email,string2,string3 How can I use regex to return the following? string1,email I want to remove everything that comes after the 2nd comma.
1
vote
1answer
38 views

Making Notepad++'s $ match the end of the file instead of the end of the line

I was wondering if there was a way of matching the end of a file in Notepad++ other than putting myself there a special combination of characters. By default, $ seems to match the end of the line, and ...
1
vote
1answer
56 views

Matching html paragraphs with at least one word in all caps

Using regex or anything, I need to match any paragraph which contains at least one all caps word. Then transform it into a header and capitalise all the content of the title. In the example below, ...
0
votes
1answer
47 views

To Search data in a given range in notepad++

I have data like this: ABC DEF 123 456 STU 567-89 XYZ 234 123 345 789 ERT FGHT TYUI FGHT 456 HHKHFS NOR TEST TEST1 5678 NOT TEST Trying to format it as below output in which I can use to ...
1
vote
0answers
41 views

TextAnalysisTool.NET equivalent for OS X

I've used TextAnalysisTool.NET in the past for analyzing log files on Windows machines and found it incredibly useful. I love the simplicity+power that it achieves for dynamically grepping log files, ...
0
votes
1answer
102 views

How do I select a range of lines until I reach a line containing specific words?

How do I select a range of lines until I reach a line containing specific words? For example, start at line 1 and select every line until you get to a line with the words: hello world
1
vote
1answer
42 views

Notepad++ 6.5 regex replace with same regex

I want to replace a regex based on a date string with the same one and a new line. The problem is that when I write the sintax like this: Replace with : (\1)\n Or like this : Replace with: ($1)\n ...
1
vote
1answer
22 views

CLI Perform Regex in Memory then feed to Command

I would like to use a regular expression to modify a file and then feed it to pandoc in the cli. Something like this: perl -pe 's/_(.*)_/\\underline{$1}/g' source.md > pandoc -o source.pdf So, ...
0
votes
2answers
129 views

Remove all but URL-s from XML files

So i have a XML with bunch of links. What i want is to remove everything that is not an URL. For example currently it looks something like this: <update extract="1"> ...
3
votes
2answers
370 views

KeePass wildcard in url

I started using Keepass yesterday and it's really useful however I cannot find a way to add wildcard into the url... I want one key being used on all url(s) that met the following rule: ...
2
votes
2answers
63 views

Notepad++ regex replace

id like to replace all the random numerical values to a solid value of a code random values ex: DELAY : 214 DELAY : 1243 and id like to replace all them to DELAY : 1
2
votes
1answer
385 views

Regular Expression to match zero or more spaces in Microsoft Word

I hope I'm just missing the obvious here, but how in the world do I match zero or more spaces with Microsoft Word 2010's "Regex" engine? As a silly example, I want to match all of the following in a ...
1
vote
1answer
48 views

How do I inverse my selection in “find and replace”?

%%& BUNCH OF TEXT &%%ASDA WR ASDAR ASDSETSF ASDSADGSRT %%& EVEN MORE TEXT &%% aSDAER ASD %%&TEXT HERE TOO &%% I'm trying to remove all of the junk text between the "&%%" ...
3
votes
1answer
306 views

How do I negate a ZSH regular expression test?

How do I negate the ZSH regex operator? I'd like to do something like: if [[ $host !~ '^myhost[0-9]+$' ]] then # Do stuff # ... fi ...or: if [[ !($host =~ '^myhost[0-9]+$') ]] then # ...
0
votes
1answer
242 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 ...
2
votes
2answers
40 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 ...
0
votes
2answers
113 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" ...
0
votes
1answer
163 views

Word wildcard search expression matching longest possible string having applied a certain character style to it

I am writing a macro to convert a Word document to LaTeX. All goes well, except one thing: The document makes heavy use of style templates, in effect using character styles to achieve a functional ...
1
vote
3answers
843 views

Delete the third char from line using sed

The following sed syntax deletes the first @ character if it exists in a string: sed 's/^@\(.*\)/\1/' But how to change it to delete the @ character only if it's in the third position? For ...
0
votes
1answer
204 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 ...
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)?
7
votes
4answers
7k views

How to list all source files (*.c, *.cpp, *.h)

I'd like to find source files (*.c, *.cpp, *.h) that contain in Linux/MinGW/Cygwin, and recursively in all sub directories. My basic idea is using find and grep. However, building a regular ...
-1
votes
1answer
78 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 ...
10
votes
4answers
26k views

Can you do Regular Expressions in Excel without VBScript?

I'm looking for an Excel function that I can put in a cell to do a regex search of the contents of another cell. Is there anything available to do this? I'd prefer not to have to add VB Script to ...
1
vote
2answers
269 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
38 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
3answers
118 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 ...
10
votes
4answers
25k 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 ...
4
votes
1answer
265 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
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 ...
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
48 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 ...
1
vote
3answers
129 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 ...
0
votes
2answers
59 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
3answers
110 views

sed regexp address case-insensitive matching

How to specify a sed regexp address which is case-insensitive? E.g., sed '/my-kw/d' But I want sed to remove lines with my-kw in any cases. Thanks
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 ...
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 ...
2
votes
2answers
172 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, ...
0
votes
1answer
137 views

Remove every second carriage return starting from line two

I have a text file where I'd like to remove every second carriage return starting with line 2. So the carriage return should be removed in lines 2, 4, 6, etc. The carriage return can is ...
0
votes
1answer
70 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 ...
1
vote
2answers
194 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
1answer
62 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
292 views

Textmate: Find and replace across project with contents of one file from said project

I have a regular expression to find the text I want (I wrapped the relevant section in custom tags), and I can do it by hand without much issue, but what I want is a way to automatically find and ...