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)

2
votes
1answer
39 views

Notepad++: Add tab at the beginning of a multi-line match found with regex?

I have text formatted like this: :AGG NUMBER 1 :TYPE Alfa any text 1 line 2 anythihng :END :AGG NUMBER 2 :TYPE char other any text 1 line 2 :END I need to add a tab character at the beginning of ...
1
vote
1answer
60 views

Notepad++ replace every 3rd and 4th iteration

I'm using notepad++ I'm wondering if it's possible to replace every 3rd and 4th iteration in lines of HTML. The original code looks like: <div class="ui-bar ui-bar-d" <div class="ui-bar ...
0
votes
1answer
85 views

Find duplicate phrases - any tool or regex

I've got a long document, and I suspect that some phrases (one or multiple sentences) are identical or at least similiar. Is there some way to find these repetitive phrases? Some tool or regex?
-1
votes
2answers
44 views

Converting Perl Regex to PHP [closed]

I have the following Regex in PERL which I need to convert to PHP if($line =~ m/[<]div class="row.* id="(vm_[0-9]{8,9})"[>]/i){ } I currently have the following in PHP to match it, but I'm ...
4
votes
1answer
57 views

Replacing quotation marks in Word (reg ex)

I have a large text document with inconsistent quotation marks, i.e. ...Dolore magna aliquam “lorem ipsum” dolor sit amet, 'consectetuer adipiscing" elit, volutpat. Ut "wisi" enim... and I ...
0
votes
1answer
36 views

In Vim, why does searching “/A\n\zsB” work, but not syntax highlighting “:syn match Statement 'A\n\zsB'”?

Assume the following text file: A B Or in other words, a file containing only the string A\nB. Let's see if I can match any B preceded by A and a newline. Simple enough. I can do this sucessfully ...
-2
votes
1answer
109 views

Notepad++: How to remove text in between two specified strings using Regex

I have following lines of data: X1+0X2+0X3+0X4+0X5+0X6+0X7-0.25X8-0.25X9-0.25X10-0.25X11+0X12+0X13+0X14+0.8X15+0X16+0X17+0X18 ...
0
votes
1answer
97 views

Notepad++ regex highlighting

I'd like to be able to highlight entire lines in notepad++ by keywords, but these keywords would be added in the end of each line. I tried with the available mechanism of "User Defined Language" ...
0
votes
1answer
33 views

What regex pattern would I have to use to parse out unwanted characters in this format?

#!/usr/bin/perl POSIX qw(strftime); my $time = strftime("%YT%mT%d TTTT%H:%M", localtime); print ("Todays date and time is $time\n"); I am a little rusty at regex, what would be a pattern to search ...
0
votes
2answers
65 views

Remove the second literal \N per line in Notepad++

I have a text file with several hundred lines similar to below: Here are some examples lines,\Nthis text needs to strip out\Ncertain, Here are some examples lines. Here are some. Here are some ...
0
votes
1answer
23 views

Restrict grepping to non-comment lines

I need to find in Perl source files lines containing bin/exim|SendEmail|Unformatted except of comment lines (lines starting with # with possible whitespace before). I know how to do it with a ...
2
votes
2answers
110 views

sed: How can I replace \r\r\n?

In this question on stackoverflow it is explained how one can replace a newline character using sed. My problem is that I want to replace the character sequence \r\r\n with sed. Can somebody help me ...
0
votes
1answer
38 views

Mark all URLs ending with .se (Notepad++)

I got a massive document with text. I want to mark all the URLs ending with .se I managed to mark the part of the url just before .se with \w+\.se. But some of these URLs got 3-4 subdomains. So if I ...
0
votes
1answer
135 views

How to Replace Words With VBScript Regex and VBA?

what is vbscript syntax for .net: \b[a-z]+\b Hi trying to replace all alpha words in the source. .net regex tester confirms this pattern will find all words: \b[a-z]+\b this: ...
1
vote
2answers
45 views

Find all php files which first or second line has more than N characters

I would like to find all php files on my server which first line or second line has more than N characters. I would like to print both the file name and the line content that was found. How would I ...
-1
votes
3answers
109 views

How to replace all but specific part of string in Notepad++?

I have a list with lines like this: 103238704-|--|-INEEDTHIS-|-r4Vp5iL2VbM=-|-maiden name|-- Is there a way in Notepad++ to delete everything except INEEDTHIS? INEEDTHIS will be an email ...
1
vote
1answer
89 views

How to replace line in file with pattern with sed?

I'm reading a lot of documentation on sed, and am still stumped on my particular use case. I want to replace this line in a conf file with my own line: Replace this line: #maxmemory <bytes> ...
1
vote
1answer
92 views

subtract a fixed amount from a number in an xml with find/replace in notepad++

It seems like I can't understand much of the notepad++ wiki, and I can't find similar question here. The problem: type="0" x="184" y="698" w="245" h="7" So I'm trying to add or subtract an amount ...
0
votes
1answer
44 views

How can I replace one Youtube URL pattern with another via FoxReplace?

Youtube changed its layout again. Now to get to a user’s uploads page you have to click on their nickname, then on the “Videos” tab, and then filter by uploads-only from a dropdwon menu. If you also ...
-2
votes
2answers
170 views

Remove all extra text before and after domain string per line in notepad++

I would like to take the following strings in and only keep the domains and <br> tags So: 390796,domain1.com,1,0,0,false<br> 390796,43domain2.org,2,0,0,false<br> ...
3
votes
2answers
345 views

How to comment out multiple line matching a regex using sed or awk

I have a file that contains this: [...] location /static { ... multiple lines ... } [...] location /static/ { ... multiple lines ... } [...] And I want to get: [...] # ...
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 ...
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 ...
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 ...
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> ...
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
-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 ...
2
votes
2answers
89 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 "\\$" ...
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"> ...
1
vote
3answers
24 views

End of line - add a pipe |

Can someone explain how at the end of each line I place a pipe with regex? Using find and replace in notepad ++ I'm trying to place content | Cheers!
2
votes
1answer
383 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 ...
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
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
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 ...
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 ...
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" ...
-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 ...
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 ...
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
2answers
39 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
178 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
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 ...