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)

5
votes
2answers
2k views

How to install regexp enabled 'rename' on fedora?

I have a batch rename task and I find the 'rename' command in Ubuntu and Fedora is different. In Ubuntu, rename is written in Perl and has regexp support. Is there anyway to install it on Fedora?
1
vote
1answer
50 views

Using regex in BASH script to grab filename/type recently created as output by command earlier in the sequence

I recently asked This question about the use of gpaste getoutput as STDIN for youtube-dl. That question has since then been answered, but I would like to move on to the next step of automation a ...
0
votes
0answers
16 views

How to use TextMate 2's Find “In” Regular Expressions?

Ok, here is a scenario, in pictures. OK, so searching all files looks in 333 files, and finds 614 matches. First result is alex/init.zsh. Fine. So I try to limit the scope a bit, with my logical ...
0
votes
1answer
111 views

Extracting lines from a large text file which follows a pattern

How do i extract lines from a text file which satisfy this regex ^2. I am using linux. I know grep is able to extract the number of lines but i would need them to be output to a text file. Is it ...
0
votes
0answers
32 views

Outlook Query to highlight messages that mention me?

In essence, I want to do some conditional formatting on messages that mention me. Below are 3 sample Messages (Bodies). The first two should be purple, the last one should not be purple because I ...
0
votes
1answer
50 views

Printing matching subgroups in a perl one liner

I have the regex[1] (/foo/bar/(GW|GREV)[^/]*).* I was able to get this to work with GNU sed with sed -n 's/\(\/foo\/bar\/\(GW\|GREV\)[^\/]*\).*/\1/p' But that was a modern GNU sed and I'm on ...
1
vote
1answer
251 views

Replace variable in string with Regex in Notepad++

I'm new to Regex and Notepad++ need to remove variables from code. For example, remove everything between the double quotes in lines like this: alt=""Frontline Plus for Dogs and Cats"" To leave me ...
1
vote
1answer
68 views

How to find the missing number in a sequence

I have a Holy Bible file which starts every line with a verse number (e.g. 1, 2, 3, 4) and so on. But on certain chapters some verses are skipped or are not present, for example 10, 11, 12, 14, etc. ...
27
votes
5answers
31k views

use of alternation “|” in sed's regex

I am using sed, GNU sed version 4.2.1. I want to use the alternation "|" symbol in a subexpression. For example : echo "blia blib bou blf" | sed 's/bl\(ia|f\)//g' should return " blib bou " but ...
0
votes
0answers
31 views

insert text and numbers in notepad++

I have this: ...something...data-src="TEXT"...something...src="images/BBP/BBP0001/01SMALL.jpg"...something... ...
3
votes
2answers
57 views

Word 2010 wildcard search - Find text in format ABC.DEF.XYZ

I am trying to find text in Word 2010 in the following format: ABC.DEF.XYZ. This is essentially finding code references, using Java syntax, written into the word document. Please note that a ...
0
votes
1answer
63 views

Transform a CSV with Notepad++

Suppose I have a CSV file like this: 1,"abc",,,, 2,"def",,,"ghi", 3,,"jkl",,,"mno" Now I need to transform it in 3 steps: Replace all empty spaces with the String NULL Add at the beginning of ...
0
votes
0answers
34 views

Find and Replace in .txt file by extracting data from spreadsheet

I need to replace instances like Manhole Name="1" with Manhole Name="SW3/001" for instance by extracting the data from spreadsheet. Would that be possible using regex, or in any possible way ? ...
3
votes
2answers
386 views

Find and replace multiple times in txt file

I know this might have been asked before, but I could not find an answer to it. I need to replace the following: CoverLevel="XX" with CoverLevel="0" , this includes XX being any number, without ...
1
vote
1answer
171 views

Match multi-line pattern in Charles proxy rewrite rule

In Charles proxy, I'm trying to use a rewrite rule to match a pattern that spans three lines in a response body, using \s* in the Match value (with 'Regex' checked) to match new lines. It appears ...
7
votes
3answers
66k views

Using wildcard search/replace in Notepad++

Here's my problem: In a .txt file, I need to find and replace thousands of instances of syntax like this: (see (a053007djfgspwdf)) or (see (a053007djfgspwdf) and (a54134xsedgeg)) or (see ...
0
votes
0answers
42 views

Regular Expression to match a dot followed by a space inside a tag

I must be missing something quite obvious, but I need to match every dot followed by a space ". " inside these tags: <example:label xml:lang="en">One. Two. Three. Four</example:label> ...
0
votes
1answer
70 views

What is the regular expression in Notepad++ which matches 1 to 8 character words?

I have a very big text file. Every line in this textfile has a one word in it. How do I search for words which are 1 to 8 characters long? [A-Za-z]{1,7} doesn't work.
2
votes
1answer
876 views

LogRotate use regex for filename

I have a custom logging class that creates a log for each instance of the process and adds a unique id to the log file name, example: process.1234.log process.1235.log Also I can add a date/time ...
0
votes
2answers
60 views

awk and regex with {}

I want to print whole record if it contain word and some character, which are optional. Script: /mount[ein]{0,2}/{ print $0} Unfortunately it doesn't work. Without "{" and "}" it work. I tried with ...
0
votes
1answer
18 views

Remove all lines after /

I have 2 lists one with this format: http://www.example.com/archives/573 http://www.example.com/1812.html http://example.com/hello-world/ but i want it in this format www.example.com ...
1
vote
1answer
51 views

Abobe Brackets how to find in a folder

In the official web: https://github.com/adobe/brackets/wiki/How-to-Use-Brackets Under the title: 'Instant Find in Files' they say: "You could even make the search in a specific folder" Can anyone ...
1
vote
0answers
35 views

MS Word, can we write a multilingual regular expression?

I want to find all the occurrences of the from x.y and change it to x,y where x and y are numbers: I was using this: ([0-9]).([0-9) and doing the replace using \1,\2 but here is the catch , if the ...
0
votes
0answers
20 views

mutt regex for limit filters

Does mutt support multi-line regex for its search filters? I cannot find an yes or no in the documentation. I'm assuming its not supported, but cannot tell if maybe I am improperly escaping my regex. ...
1
vote
1answer
17 views

Vim: Columising a long line of arrays

In writing tests I often want to compare a generated value to something I've previously generated, but dumping the output from my console into vim leads to a very long ugly line. Is there any way to ...
7
votes
3answers
9k views

Grep: count number of matches per line

I'm trying to get the number of matches (in this case occurrences of { or }) in each line of a .tex file. I know that the -o flag returns only the match, but it returns each match on a new line, even ...
1
vote
1answer
26 views

How to remove pattern containing blank space and special characters in sed

How to remove following words from a text file: DEFAULT ('') DEFAULT ((0)) DEFAULT (((1)/(1))/(1900)) DEFAULT (getdate()) I am not able to delete above four pattens using sed.
0
votes
1answer
40 views

VLOOKUP returning N/A because references contain “.” and “ ” in one table, not in other

OK I am trying to vlookup a table but the problem is the references on one table are slightly different to the references on the other table. I can get the VLOOKUP function working, but it is ...
-1
votes
1answer
71 views

replace/rename directory name using regex

i have multiple folder with this pattern "720p.MP4-ABC[abcde]" trying to replace or rename "720p.MP4-CAB[aedcb]" to "."
5
votes
3answers
2k 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: ...
1
vote
1answer
56 views

Notepad++ find and replace string or text with new string or text

I have some code several hundred lines long and I want to find each "String" and replace it with a different "String". Example below... $BR360Button.Add_Click({BR360Button}) ...
0
votes
1answer
28 views

How to remove lines not ending in a number?

How do I null or better yet, remove, the lines in a file that do not end in a number [0-9]? I'm using gvim blahblahblah delete this line foobarbizzbuzz keep this line because it ends in 9999113 ...
0
votes
0answers
23 views

HTTPD 2.2.15 AliasMatch

I have built a regex for an AliasMatch that tests out fine against the PCRE tester at regex101.com. The task I am trying to accomplish it to allow any alias matching a pattern to refer to a common ...
0
votes
1answer
19 views

Quotes in sed when used in bash script

I am generating sed expression in Bash script, and I am having a following problem. I want to add a space in front of each appearance of abc. This commands works as expected echo abc | sed -e ...
2
votes
2answers
1k views

Replace every nth instance of a character with a new line in Notepad++

I have a pipe delimited string of NAME|VALUE pairs looking something like this.. Name1|Value1|Name2|Value2|Name3|Value3 What I want to do is to replace every second instance of | with a new line so ...
1
vote
0answers
77 views

Search & replace speed in Notepad++ / indexing

I am using Notepad++ to search and replace in around 60, 000 files, one folder. It only seems to be processing around 2 files per second, is there any way to speed this up? I have an i7 processor ...
0
votes
1answer
423 views

VIM: Yank multiple non-continous chunks of text into a registers

I have some lines of text that follow a pattern and some that don't. I'd like to copy the lines that follow this pattern and then copy/yank them into a register so that I can paste them as is ...
2
votes
1answer
79 views

Notepad++ regex find/replace adjacent ids

I have a csv file that looks like this: ID, term, functional category GO:0008166,viral replication,P, GO:0008167,sigma virus replication,P, GO:0008168,GO:0004480,methyltransferase activity,F, ...
1
vote
1answer
98 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
1answer
35 views

Excel search character range

Is it possible to use character classes ([A-C] or [abc]) instead of wildcards in the SEARCH function of excel? I want to do something like the following: =SEARCH("[AB]"; A1) This should result in ...
0
votes
0answers
65 views

How expand NSDataDetector's NSTextCheckingType and corresponding pattern?

I want detect some condition more than NSDataDetector's internal types, so need know whether IOS system already provide a interface for expand NSTextCheckingResult. apple document just say: the ...
0
votes
1answer
61 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
78 views

regex to match everything but substrings beginning with hashkey

I am building a regex to filter out any substrings beginning with '#' or '@'. I am trying to filter tweets from those. Currently it matches everything no matter if the string contains words beginning ...
1
vote
2answers
563 views

How to search for any files that do not contain a proper XML root element?

I need to be able to search several thousand XHTML and XML files and see a list of files that do not contain the following string on the first line: <?xml version="1.0" encoding="utf-8"?> How ...
2
votes
2answers
37 views

Delete everything in second column not in parentheses

I have a file that looks like this: gene ID protein Solyc06g062540 (Z) PYROPHOSPHATASE 3 (PTHR20889:SF0) Solyc10g075050 ALBUMIN SUPERFAMILY (PTHR33076:SF11) Solyc07g061760 ...
2
votes
0answers
60 views

Regex expression cuts zero in the end

I have a script with powershell regex in it, and after I upgraded from Windows 7 to 10 it working different. Regex: if ($srv -match '^[0-9]{1,3}\.[0-9]{1,3}$'){$srv = "192.168.$srv"} Expected: ...
1
vote
2answers
58 views

Notepad++ Regular Expression Assistance

I am currently trying to find \000\000\001\031704_news_release.pdf Which I have successfully done with 000\\000\\\d\d\d\\ I am pretty sure I am doing something wrong here though because I want ...
0
votes
2answers
139 views

Notepad++ comment all lines containing string or all bookmarked lines

I wanted to comment out some java code using Notepad++ e.g. StringBuffer sbTest = new StringBuffer(); sbTest.append("aaa"); sbTest.append("bbb"); sbTest.append("ccc"); sbTest.append("aaa"); ...
1
vote
4answers
1k views

using sed to remove lines in a file

I have a file that looks something like this: Heading - - Completed foo - More information - Still more * Need to complete bar - Did baz (comment blah blah) *** Another - * Need to ...
0
votes
0answers
17 views

FatRat - How to add FTP credentials?

I am wondering, how to add FTP credentials to FatRat? You have to insert an regular expression, but how exactly does it have to look like? Anyone has an example of an regular expression? For example ...