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
votes
3answers
329 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
891 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
219 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
82 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
412 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
550 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
160 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
27 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
3k 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
46 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
73 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
66 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
1answer
778 views

How to find and replace in the between tags in notepad++

I have a problem about find and replace in notepad++. I want to find a space+space in text and replace with just one space. But the area I want to find and replace is between tags (ex: ...
0
votes
0answers
56 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
275 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
84 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
482 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
69 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
25 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
1answer
77 views

How to extract everything between <table> and </table> in multiple HTML files

I have been trying to extract this data for a couple of hours without luck. I either want to just extract all the table tags from the HTML and save them to a separate file or everything between these ...
0
votes
2answers
289 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
83 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
1k 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
94 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
73 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
719 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
343 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
522 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
173 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
1k 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
467 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
50 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
53 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
2k 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
1answer
24 views

How to replace a character from a variable location of a string up to the last character

Question, please: How do I remove characters starting with _ then all the way to the end. Examples are: FC1-46-SCD-02-008-11_14P will be FC1-46-SCD-02-008-11 FC1-46-SCD-02-0008-11D_0P will be ...
2
votes
3answers
458 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
3answers
354 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
66 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
356 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 ...
-1
votes
2answers
54 views

How to delete word and all words after that

I have this URL: https://www.facebook.com/photo.php?fbid=611377065590688&set=a.320150204713377.74079.229899403738458&type=1 I want to be: ...
0
votes
2answers
58 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
75 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
38 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
68 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
41 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
40 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
93 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
313 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
297 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
191 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 ...