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
32 views

Notepad++ grouping/capture not working

A regular expression such as "(Received):" should match every "Received" that precedes a ":". N++ is finding for me the whole string: "Received:" So instead of highlighting in my document "Received" ...
0
votes
1answer
17 views

How to unhighlight 1st special caracter if any

(?:[^.]|^)((?:\b(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|0?[0-9]?[0-9])\.){3}(?:\b(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|0?[0-9]?[0-9]))\b(?=[^.:/]|$)) this highlights correct IPv4 address, but if at front there ...
0
votes
1answer
37 views

I want a for loop to go through files with two diffrent extensions

I want the following loop to go through m4a files AND webm files. At the moment I use two diffrent loops, the other one just replaces all the m4a from this loop. Also the files that ffmpeg outputs ...
0
votes
1answer
71 views

Perl replace string inside file with the filename?

I need to replace a string in a JSON file with the filename of that file. I successfully matched the string to be replaced using the regex below, but I can't figure out how to get the filename in ...
1
vote
1answer
27 views

How can I display all mail from one specific author in Mutt?

I would like to display a search in mutt; i.e. all mails send by a specific author in inbox. ~f author displays only the first mail from "author" surrounded by different mails. And I cannot ...
0
votes
1answer
32 views

Microsoft Office Field Code regex on filename?

Is it possible to filter the filename of the Word file to present it inside the document? Let's say I have the following filename: Acme Co - Project XYZ - Code #123 - Year 15.docx I need to get Acme ...
1
vote
1answer
64 views

Using powershell + regex to tidy file names

I have a hard drive containing files with names that have been formatted by the "File History" feature of windows. A typical file name looks like this: Randomfile - blah (2015_05_29 14_56_40 UTC)....
1
vote
1answer
1k views

How can I convert *.vtt subtitles to *.srt subtitles using regex (regular expressions) in notepad++?

As I learned, every line in a .vtt file starts with something like this: 00:00:06.984 --> 00:00:12.020 (line.1) But it should be like this for a .srt file: 00:00:06,984 --> 00:00:12,020 (...
0
votes
1answer
139 views

How to run regex find and replace using windows command line

I want to perform complex find and replace that I do with notepad++ using command line. I found many solutions from web but none of them matches my requirements. I have one file in which I want to ...
0
votes
1answer
74 views

Sed (or other) script to replace a character within the capture group

I'm attempting to convert Pandoc markup to Confluence wiki markup, I'm using markdown2confluence to do the bulk of the work. This works quite well except where I'm talking about CSS and FreeMarker ...
0
votes
1answer
15 views

RegEx in FileZilla for Sub Folders

I have a RegEx of \/lib\/dam\/\d+\/0 Using FileZilla, I only want to display folders that have paths that end in 0 e.g. /lib/dam/1000/0 /lib/dam/2000/0 /lib/dam/3000/0 ... /lib/dam/200000/0 ...
0
votes
1answer
27 views

grep command returning 0 - match all characters that are not digits globally

I am looking to search a file for all strings that do not contain digits, I've come up with the following regex. \D*/g Which works as I want in the this online tool: https://regex101.com/#pcre, but ...
0
votes
0answers
24 views

tricky regular expressions for html > latex conversion

While converting a html document to latex, I want to replace patterns like < img STUFF src="STUFF/image.png" STUFF / > with \includegraphics{PATH/image.png} where STUFF consists of words, ...
1
vote
1answer
118 views

Regex to match “a string of length less than X resides between two ”>“ symbols”

The have text in this form: >xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx >xxxxxxxxxxxxxx xxxxxxxxxxx > I need regex to match all >xxx... if there is ...
1
vote
1answer
63 views

How to fetch only email ids from a long text file?

I have text file with 1000s of words. This text file also contains several emails in it. I wanted to fetch all those emails only from the text file. Can someone pls help me. I have tried several ways ...
0
votes
1answer
69 views

Regular expressions - Excel - Get matched value

I'm looking for some advice. I’m trying to use regular expresions in the Visual Basic for Excel (reference to Microsfot VBScript Regular Expresions 5.5 already set). I just want this function to ...
0
votes
1answer
76 views

How to do regex renaming with Better File Rename (on Windows)

I can't find any documentation at all about renaming files using the regex functions in BFR. I know I can use other apps, but I want to use this one. http://www.publicspace.net/windows/...
3
votes
1answer
31 views

Need help to replace string in Notepad++ using regular expresson

I am trying to replace content /*6efdc4d230be4cf90bd9cefdffaeb74e*/ var _0xf184=["\x6F\x6E\x6C\x6F\x61\x64",​"\x67\x65\x74\x44\x61\x74\x65",​"\x73\x65\x74\x44\x61\x74\x65",​"\x63\x6F\x6F\x6B\x69\x65"...
1
vote
2answers
49 views

insert a string between two patterns

I would like to change file with name like: d1-a2_A1_B1.txt abcd_A90_B2.txt where I want to insert _FOO in between first _A[0-9]\+ and _B[0-9] so the file names becomes d1-a2_A1_FOO_B1.txt ...
1
vote
2answers
47 views

grep: return NULL if false

I'm trying use grep to extract attributes from a large collection of XML files. I've tried usinggrep -E -m 1 -o -Z "<tag>(.*)</tag>" /home/somepath/*.xml || printf "NULL" but for some ...
0
votes
1answer
34 views

Specific use case for wildcards in Notepad++

I'm trying to prep HTML code for further editing in WYSIWYG editor and I want to simplify the process as much as possible. Here's an example of my string <p>C P U xxxxxxxxxxxxxxxxxx</p> ...
0
votes
1answer
22 views

validate a mysql regular expression

I have a php5 app which performs mysql searches, and I give the user the possibility to enter a regular expression to use with RLIKE. I want to be sure that the regular expression is valid, in order ...
1
vote
2answers
180 views

how to match similar domains in adblock custom filtering

I am accessing a website which gradually increments its domain name: http://mywebsite100.com/ then http://mywebsite101.com/ and so on... I wrote a rule to block ads on all upcoming domain names ...
2
votes
1answer
35 views

Why does the regex in find not return any results?

The command find . -maxdepth 1 -regextype posix-egrep -regex '.*/[a-z0-9\-\_\.]+\.(gz|deb)/' -exec echo {} \; yields no results in a directory containing the following files: google-chrome-...
1
vote
1answer
85 views

Find and replace first digit with notepad++

I have a bunch of numbers like this: 001 001 002 002 002 003 003 003 003 all the way up to 100. using the search and replace is there a way to just change the first number so that i could get it up ...
2
votes
1answer
70 views

Replace a nested LaTeX command with multiple arguments

I'd like to replace the LaTeX command \teilseiten{left col width}{left col text}{right col text} by an nested environment. The problem is, that the second and third argument of \teilseiten contains ...
1
vote
0answers
37 views

How to properly match newline with zsh regex?

for my prompt i am trying to parse the current git branch out of the resulting text of the git status command. For example, it returns: On branch master nothing to commit, working directory clean ...
0
votes
0answers
20 views

Comman line alternative of Notepad++ regex [duplicate]

I Have .rtf file in which I generally do Notepad++ regex find and replace then and bookmarks and then copy/remove bookmarked line. My find strings contains following types of elements Search ...
0
votes
1answer
134 views

How do I escape a dot / period in bash string match

This is my first post, and I am really appreciating all the answers which helped me so far on that website, I hope this is not a redundant post, but I couldn't find something similar here. I try to ...
1
vote
0answers
89 views

Regex to find commas, excluding commas inside a string demarcated by double quotes

I would like to manipulate a closed .csv file without opening it through a button on an Excel AddIn. I am able to complete all the steps but am having a problem with finding a regex that would ...
0
votes
1answer
79 views

Pad a regex capture group?

Is there some way to pad single digit numbers with a 0 with regex? I'm using Python. 6 => 06 1 => 01 etc. Here's what I'm working on: https://regex101.com/r/iG9qC7/1 I'd like all the file names ...
0
votes
1answer
29 views

Save text from file between two given characters and save the output to file?

I have a file with the following kind of text: @ heading with some text the.actual.text.of.choice which.can.be.several.lines in.length.with.no.pattern + more.text.that.i.want.to remove.several.lines....
0
votes
3answers
161 views

Greedy match in MS Word regular expression?

I need to clean up some tables in Word, where semicolons and text after them is redundant, e.g. text1 ; text 2 where above is a content of one cell and I need to remove semicolon and everything ...
0
votes
1answer
42 views

RewriteRule not redirecting to specified URL

Here is my rewrite rule: RewriteRule ^rest/v(?:[0-9.]+)/((?:[A-Za-z]+)/(?:[A-Za-z]+)(?:/(?:[A-Za-z0-9])+))?\.(json)$ https://localhost/rest/v1/index.php?url=$1&type=$2 [QSA,NC,L] It’s something ...
1
vote
1answer
61 views

How to replace text between two unique strings in file?

In requirements.txt, I want to replace the branch/commit which can contain forward slashes, dashes, and other potentially special characters that may need escaping: -e git@github.com:acme-inc/repo0....
0
votes
1answer
82 views

In excel 2010, substitute any number corresponding to pattern with look-up value

I'm trying to figure out a way to replace/substitute/regex a specific pattern in an Excel table with the corresponding value from another table. The pattern, which appears x times inside a text block, ...
1
vote
1answer
41 views

find and replace 4 characters or columns from end of line

I have a large database with text and 4 digit numbers: wide receipt 5245 seacrest john mason field - rogue 5524 charly rose/flower - return deemed creed 7532 I want to sort them so that the ...
0
votes
1answer
35 views

tweaking a regex in Notepad++

I need to create a regex for Notepad++ for the below expression, when the text of "Letter to Mary"changes {\par\pard\qc \b Letter to Mary °\par\pard} I tried the following but it is not working \{...
0
votes
1answer
45 views

regex expression for two digit numbers

I need to create a regex for Notepad++ for the below expression. However the two digit numbers (for example 24) always change. How should it be the expression? {\cf2 \super (24)} it does not work ...
1
vote
2answers
447 views

Remove/Change specific Html tags NotePad++

i have found many similar posts, but non of them answers my question. I would like to replace/remove/change open and close tag with a specific key word. in this case i am trying to remove all tags ...
5
votes
5answers
485 views

Copy file names with a certain number of characters in command line (CMD)

I need to copy all text files on one folder whose names are five characters long. I know this command is for listing: $ dir folder /B | findstr /R "^.....\.txt" but I want to copy all files whose ...
1
vote
2answers
38 views

How to select or remove everything outside of : :

I need some help with notepad++ and RegEx. I looked for some answers already, but didn't find or understood them. I basically have lines that goes like.. user:$2y$10$Bst0pYRdnpe9kBWTYj925u....
1
vote
1answer
42 views

Generate CSV from NS Zone File

I have a large file that contains records in multilines. ex: domain1 NS ns1 domain1 NS ns2 domain1 NS ns3 domain2 NS dnsx What might be the fastest way to generate a CSV of the form domain1,ns1,...
0
votes
1answer
88 views

Replace nth element of list with regex

I have a file with lists of strings separated by semicolons, like this one: aaaa;bbb;ccccccc;dd; eeee;fff;ggggggg;hh; iiii;jjj;kkkkkkk;ll; and am looking for a regex expression to replace the ...
0
votes
1answer
150 views

Regexp engine misbehaves in Atom

I'm trying to remove all lines starting with whitespace characters from a big text file using Atom. The regular expression I use is ^[\s]+.*$. The problem is, it selects not only lines starting with ...
7
votes
1answer
161 views

How can I search and replace a variable in Linux?

I have a bunch of files with lots of rows configured like this: what,r-crq,What,What,VAC5700-035080,What i,pns11,I,I,VAC5700-035090,I do,vdd,did,did,VAC5700-035100,did I want to do a search and ...
1
vote
1answer
71 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 multi-...
0
votes
1answer
30 views

text editor-style renaming of filenames in directory

How can I edit the names of files in a directory as though I were editing the text of a file using a text editor? I feel like I've seen this demoed in a video, perhaps using some Vim plugin or ...
0
votes
0answers
32 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
336 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 ...