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

Editing gcode with vim regex

I need to edit gcode for a model in particular I have to substract number 87 from all Z coordinates. Here is sample of gcode: ;LAYER:435 G0 F9000 X-38.420 Y-26.887 Z87.300 ;TYPE:WALL-INNER G1 F1800 ...
0
votes
2answers
151 views

What terms in my regex should I use in place of /b to not be subject to interference by control characters in MS Word or its brethern?

I am using Dynamic Hotstrings as part of my implementation of AutoHotkey. It has been an invaluable tool in the learning of Regular Expressions. Currently I use it heavily for text expansion within ...
0
votes
1answer
41 views

Notepad++ RegEx Help Please

I would like to use notepad++ to remove all text after the / in a domain url. I have a huge list of domains and some of them have a specific page or address after the domain name. I want to strip the ...
1
vote
1answer
187 views

Regex append a string to a part of the match

I find this quite hard to do, the thing is as follows: I have a string in the form: GlobalParameters::$docId = DocList::$PARTNERS; And I want to append the string _VIEW to the end of the symbol. ...
0
votes
1answer
849 views

Add new line after words matching a specific pattern

I'm trying to add a new line before and after a hyphenated word (one or many hyphens) in Notepad++ Input This is a search-and-replace test which I need-help to figure-out</h2> Output This ...
1
vote
2answers
36 views

Having trouble replacing a specific hyphen in directories that follow a specific format in Bash

I have a list of directories using the format: 2014-12-03 13-03 2014-09-03 12-07 etc. I need to change them to: 2014-12-03 13:03 2014-09-03 12:07 … I’m trying to do this with for d in *\ ...
1
vote
1answer
42 views

How to delete the 3rd occurrence of a pattern in a file, and beyond

How can I find the third occurrence of a pattern in a file (Note: not in a line) and delete the line containing the pattern and n lines below that (say, 5 lines below). e.g., COVER fafjasfj isfapifj ...
13
votes
2answers
716 views

Is there a way to search for a pattern in a MS Word document?

Is there a way to look up patterns inside an MS Word document instead of an exact match? I have a document where all decimals have been written as / instead of .. For example, 1.02 has been written ...
1
vote
2answers
334 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 ...
0
votes
1answer
208 views

Notepad++ search and replace with current line number

I am using notepad++ and am using it to create 200 copy commands. Each line starts copy \\server\\folder\a.pdf 1.pdf I want the 1.pdf to be a different file name for each line so I was thinking of ...
0
votes
0answers
28 views

Exclude during search and replace but in Word

This is an extended version of question Is there a way to search for a pattern in MS Word document?. What if there is a number as below? 124/555% 123/3333 1233345/1222% So how can I ...
0
votes
1answer
305 views

Microsoft Word wildcards

I have a document that has the word "The" capitalised in many places it shouldn't be. I wish to change "The" in those cases, to "the". I need to change any instances of "The" that are not at the ...
0
votes
1answer
367 views

Regular expressions in Microsoft Office 2013

I read the articles on regular expressions in Office already. My wish is to manipulate quoted strings. I need to replace the quote characters with parentheses. For example: "Hello World." ...
3
votes
2answers
2k views

Regular expression for search and replace in Microsoft Word

I need to do a search and replace for the text below in Microsoft Word. Skill No 24: And replace it with: Skill No: 24 What should the syntax be?
0
votes
1answer
54 views

youtube-dl -o cannot insert single backslash in config file (windows)

I have created a file in the %APPDATA%\youtube-dl\config.txt as suggested at from the youtube-dl doc I need to place the output of the file to **D:\Personal\music** but the problem is that I ...
0
votes
1answer
18 views

Including and excluding in one regular expression

We're using HP SiteScope system at work to monitor logs and get alerts when a special string or combination of strings is caught. There is one field where the regular expression that catches the ...
1
vote
2answers
53 views

How to apply regex to large text file?

I have large text files (some mega) example and I would like to know how if there is a more efficient way to apply regex than to PyCharm or SublimText 2 on Mac OSX. Thanks. Comment: I want to ...
1
vote
1answer
59 views

Convert text to table

I would like convert text into a table. Here is a link to the text http://www.tcdb.org/public/tcdb Short example: >gnl|TC-DB|A0CIB0|1.A.17.3.1 Chromosome undetermined scaffold_19, whole ...
0
votes
1answer
221 views

How to use backreferences in oracle sqldeveloper find/replace

How do you use backreferences when doing regular expression find/replace in Oracle SQLDeveloper? \n doesn't work for me and neither does $n.
-1
votes
2answers
3k views

Why escaped single quote doesn't work in grep?

I am trying to match a string: * * * * * /usr/local/bin/growlnotify -t 'helloTitle' -m 'helloMessage' -n 'myApp' -sw with: crontab -l | grep '^[^#].*/usr/local/bin/growlnotify.*\-n \'myApp\'.*$' ...
4
votes
1answer
2k views

remove numbers from filenames in Mac OS X

I have a directory full of files with names in this format (with numbers as the start of each filename): 102_file.txt 104_list.txt 242_another_file.txt I would like to rename them as follows (i.e. ...
0
votes
1answer
60 views

Search and replace option in notepad++ for making a dictionary

We've gotten several files from a professor who published his dictionary and we convinced him to make it open source and make it freely available online. So now I've ended up with several files with ...
2
votes
3answers
58 views

Are there any simple windows utilities to monitor a text file and capture contents if a “trigger expression” is seen? [closed]

One of our customers (and not an especially computer literate one) is experiencing a problem that we are unable to reproduce. We have a Windows application with verbose log files available (using ...
3
votes
3answers
1k views

Deleting Duplicated Lines In TEXT File?

I am trying to cleanup a text and for some reason every line duplicated 3 times am i able to get ride of duplicates with regex or tricks or do you know a software which could do that , text file is ...
4
votes
4answers
84 views

Apply regex to certain occurrences

I have a large file with plain text (no html tags, etc.). What I want to do is to apply regex to whole file on the one hand but on the other I want to choose which changes will be applied. For ...
1
vote
1answer
51 views

How To Search for multiple multi-word strings in vim?

For example I'm trying to search for the occurence of both hello world and goodbye world in the same line. I've tried a bunch of difference iterations. For example, if you want to find one multi-word ...
0
votes
2answers
71 views

Bash - Fixing messy output

I'm not sure how/why this is happening. Basically I have a command that is supposed to find and clean out all files in the desktop that contain a certain pattern. I am doing the first part using: ...
1
vote
1answer
3k views

Perl for matching with regular expressions in Terminal?

I'm trying to familiarize myself a little with Perl to use for regular expression searches in Terminal (Mac). Now, I'm not really looking to learn Perl rigourously, just trying to find out how to do ...
1
vote
3answers
10k views

How to use sed to replace a pattern at the end of each line in a file with fixed text?

I want to compare two files of around 40 MB of comma separated values with lines like this: hstar,default,"T9883Z ",0d59,c801,7332,5,20120914,4.343618767 For the two files, the last entry which ...
0
votes
2answers
56 views

Replace but leave between characters unchanged

I need to replace but leave between characters unchanged: Example: <column name="propertys_uid">30</column> <column name="property_name">Villa</column> <column ...
1
vote
1answer
114 views

Regular expression/Wildcard find replace to change date format( 9/7 --> September 7th) in Word

I am editing a large document that has mansy date in mm/dd format. I would like to change them to "MMMM ddth" format. I am wanting 9/10 to be changed to September 10th. Seems like it should be: ...
-1
votes
1answer
26 views

Regluar expression - Remove Numerical Entry

I want remove entries such as 0:1.2 and 14:12.4 and 196:4.6 from a text file using regular expressions. A sed, awk, perl or generic regex suggestion would be appreciated.
8
votes
5answers
9k views

How to list all source files (*.c, *.cpp, *.h)

I'd like to find source files (*.c, *.cpp, *.h) that contain in Linux/MinGW/Cygwin, and recursively in all sub directories. My basic idea is using find and grep. However, building a regular ...
0
votes
1answer
209 views

Saltstack regular expression to target all except

I'm having trouble using regex with salt to target every minion except one. I have tried every example I can find and exhausted my limited understanding of Perl regex. I expect this to target every ...
0
votes
1answer
55 views

regex not working as expected in grep

My problem is about a regex. Thanks to regexr, I managed to write up an expression that matches the interface name route linux command gave me. But I can't catch it with: route | grep -Eo ...
1
vote
2answers
45 views

Can we use regex in alias command?

I want to create the alias for this command. ssh user@ip as alias [0-9][0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9].[0-9][0-9][0-9] ="ssh user@$0" I have created it ,but it is not working. Is there ...
1
vote
1answer
232 views

Proper syntax for escaping a `$` in a regex in a bash shell script/makefile?

I'm running a Makefile which includes the following line... find ./ -type f -regextype emacs -regex ".*tests$" | xargs rm -f and am getting an error: find ./ -type f -regextype emacs -regex ...
0
votes
1answer
20 views

how to print pattern match

I am trying to get versions for services in a gnmap file. A typical line looks like: Host: 192.x.x.x () Ports: 21/open/tcp//ftp//HP JetDirect ftpd/, 23/open/tcp//telnet//HP JetDirect printer ...
0
votes
0answers
18 views

Why does sed accept \s (only when not in a character group)?

Okay, so I have always used \s to match whitespace but now I have been having a bit of difficulty as with sed, while trying to do a negated character group match [^\s] I found this does not work. ...
0
votes
2answers
84 views

Notepad++ Replace Iteration

(I have edited this post for clarity) I have a terribly formatted text document.. Luckily, though terribly formatted, it's reliably terribly formatted and so regex has saved me days worth of work. ...
-1
votes
1answer
139 views

Mac Word 2011 Regex

So my question is about regular expressions in Mac Word 2011. I have the following phrases that need to be found within a document and would like to get rid of them all at once. Examples: [set C/G, V ...
2
votes
2answers
626 views

bypass character limit in Sed and the replacement / character?

I'm Using windows Xp. I want to replace a word of length 200,000 characters and CMD has problems (the input line is too long). With Linux, does the terminal have same length problems? If I replace ...
4
votes
4answers
473 views

deleting folders in linux bash

i'm trying to delete in gnu/linux all folders inside another folder that start with a "." (dot), for that i'm using the find utility, this is what i have: find . -iname ^\..* -exec rm -rf {} \; but ...
0
votes
2answers
56 views

Delete lines which have a particular word

I have a list of links like this http://mysite.com/wp-content/uploads/dogs-24x100.png http://mysite.com/wp-content/uploads/dogs-640x2648.png http://mysite.com/wp-content/uploads/dogs-72x300.png ...
2
votes
3answers
4k views

How to use cygwin (or linux command) to rename the files and directories recursively with regular expression

I am using Windows, and trying to use Cygwin to perform this task. I would like to rename the files and directories recursively as following: From: 1010110010\ 1010110010\1010110010.jpg ...
0
votes
3answers
246 views

How to switch and merge text lines in Notepad++

I'm using Notapad++ and I have 2 situations here that I'm stuck with, regarding large text files that have lists of verb conjugation for my students, to use with a database of an android app. ...
0
votes
1answer
119 views

Linux find files in subdirectories by extension (.txz) then move them to specified directory using regular expressions [duplicate]

I have mirrored a directory from a server with a large number of sub directories, each of which contain a .txz package and the usual .txt and descriptor files. What I would like to do is the ...
0
votes
1answer
43 views

is there a way i can either insert a character into a line or substitute and arbitrary character with itself plus some other carachter(s) in sed?

like say i have a string of numbers that constitute a phone number and are like so ########## and i want to format them like : ###-###-#### insert only puts in new lines, and i dont know how to ...
0
votes
1answer
76 views

Adding syntax highlighting for a comment section in Emacs

I have the following (defun add-c-syntax-highlighting () (font-lock-add-keywords nil '( ("\\<\\(\\-+\\)" 1 font-lock-warning-face prepend) ("\\<\\(FIXME\\):" 1 ...
2
votes
2answers
88 views

Performing a regex replace on a 900 MB logfile

My beloved TextPad says "out of memory" after a while when trying to perform this operation. Next best (i.e. simplest/fastest) free tool to do this?