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

Remove spaces at beginning of line if first non-space character is a letter (Notepad++)

I am using Notepad++ to cleanup some wiki code and would like to do the following: I need to remove all leading spaces from a line but only if the first non-space character is a letter. Here's an ...
0
votes
1answer
35 views

Regular Expression - Where string contains 'bar' but is not preceded by 'foo'

I currently have a regular expression to match where a string contains 'bar' but is not preceded by 'foo': (?<!foo)bar I wish to modify the regex to match where a string contains 'bar' but is ...
0
votes
1answer
16 views

How to match a word followed by anything in Notepad++

I want to enclose the first word with brackets and the "anything" that follows after the space by brackets too. Unfortunately the command : (\w) (.*) doesn't work. For example, for the sentence "How ...
0
votes
3answers
45 views

Notepad++ Regex to replace the 4th character of each line in a text file.

I have a large text file and want to replace the 4th character of each line. Cloud you please suggest a Regex to do that in Notepad++?
2
votes
1answer
25 views

sed, regex replace with vars

I'm trying to use sed (4.2.2-4+b1 debian 8 (jessie)) to replace text in multiple files. To go from this: $var1 = array(foo=>"bar",bar=>"foo"); $var2 = array( foo=>"bar", bar=>"foo" ); ...
1
vote
1answer
29 views

Replace returns wrong capturing group

I have a text file that looks something like this: ,'','a','bc','def','ghi','lmn','op','qr','stu' I'm trying to replace groups of 5 with the match and a line break for easy readability. So, I'm ...
-1
votes
0answers
10 views

removing part of a text in postscript with regex [closed]

does anyone have a clue how to remove part of a text string in postscript using regex? I have a string that is roughly like this: this text to be removed.this part stays So I want everything ...
2
votes
1answer
37 views

Remove trailing whitespace at the end of table cells

I have opened a PDF file in Word in order to edit it (the original Word document is lost). During the conversion, each line of text and each table cell was given an extra space. Of course, they don't ...
0
votes
1answer
18 views

How to extract only a part of a string

I have a batch file using wget and grep that downloads a website, and then extracts the fallowing string from the source code. <p>11.59 €</p> As you can see, grep included the paragraph ...
1
vote
1answer
38 views

Assistance with RegEx in Word

I have a Word 2010 document containing a list of blocks with predifined styles. The styles are used in another software to process these blocks. I created the document using a wrong quickpart so all ...
0
votes
0answers
6 views

Is there any way to keep “Regular Expressions” checked by default in TextMate?

When I use the find/replace dialogue in TextMate2, 95% of the time I want the regular expression behavior. However, every time I restart TextMate, it defaults back to leaving it unchecked. It also ...
0
votes
3answers
21 views

Use of the “OR” Regex operator with the find command

There are so many of these questions on the net, but I was unable to solve this simple problem. I have a directory with a lot of images, but I only want to copy a subset of them identified by ranges ...
0
votes
1answer
19 views

Regex directory renaming

I'm not great with regex and can't figure out why this is selecting the next character after the - /[\-][^ - ]/g with that, it selects - and the following character. I want to select the dash ...
0
votes
0answers
6 views

Can Spamassassin be made to advise match details in description

I have a number of Spamassassin rules which use simple regex. Normally this regex is matching something like /(opt1|opt2|opt3)/i When a rule matches, is there a way I can include the matched code ...
0
votes
1answer
41 views

Notepad++ or Vim Document Wrap or Text File Wrap

This is going to sound weird, bear with me. I am not looking for the regular word wrap, which I already know how to toggle. Is there any possibility to do a "document wrap" or "text wrap" in ...
0
votes
0answers
45 views

Searching for a string with grep

I'm looking for a way to retrieve a dollar amount from a website using a combination of wget and grep. This is what I've got so far: wget http://csgobackpack.net/?nick=jotnova -q -O - | grep -o ...
1
vote
1answer
24 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
16 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
24 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
33 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
19 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
27 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
38 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 ...
0
votes
1answer
85 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
44 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 ...
1
vote
1answer
49 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
14 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
25 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
18 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
40 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
48 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
37 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
37 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. ...
3
votes
1answer
25 views

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

I am trying to replace content /*6efdc4d230be4cf90bd9cefdffaeb74e*/ var ...
1
vote
2answers
27 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
41 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
24 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
19 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
51 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
32 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: ...
1
vote
1answer
35 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
43 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
20 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
19 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
53 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
46 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
42 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
25 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 ...
1
vote
3answers
72 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
19 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 ...