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)

3
votes
2answers
370 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
2answers
2k views

Match regex pattern only in filename.extension

I need to use find to locate a file matching a regex pattern in filename.extension instead of the default, which matches /path/to/filename.extension. For instance: /folder |--a-love-song.ogg ...
0
votes
2answers
176 views

Regex Pattern for Proxy

I am trying to match proxy patterns using the following regex: ((?:\d{1,3}\.){3}\d{1,3}):(\d+) It is working well thus far, but is not matching the following: 218.25.249.186:80 Any ideas? Thanks!
-1
votes
2answers
118 views

Replace all numbers following a specific string with another number using sed or awk

I have tried several things but got no luck. I have an input file that has a lot of fields like this one weight=0.123456 mixed with other fields. I want to multiply all such weights by a factor, say ...
1
vote
1answer
138 views

How do I use regex curly braces in SublimeText2

SublimeText's regex parser doesn't seem to work like others. If I write (.*{50, 51})+, or (.*{50,})+, or (.*{50})+, it doesn't grab sets of 50 characters. I think it tries to match the { as a ...
0
votes
1answer
128 views

Expression help for Find and Replace in Notepad++

I'm fuddling my way through using regular expressions in notepad++ with some .xml files, and may have gotten a little over my head. I'm currently trying to search for anything that starts with: ...
0
votes
1answer
165 views

Enable an epel repo via script?

I'm installing the Epel repo via a shell script, the repo comes by default disabled, I would like to enable it so the script can install further packages. The following install the Epel repo: yum ...
1
vote
2answers
596 views

How to search and replace any digit at beginning of an MS Word paragraph?

Trying to do a find a replace on any paragraph that begins with a number. Tried this in Find and Replace: Find what: (^13)(^#) But get the error ^# is not a valid special character for the ...
0
votes
1answer
3k views

RegEx to return string between 2 specific characters?

Can you please advise on how to return a string between 2 specific characters? Example http://sds.01/create/http/capital/870745800/create/period_1_1364871116_438861511.ssa I want to return : ...
1
vote
1answer
279 views

zsh fail to expand apt-get regex?

zsh seems to fail expand apt-get regular expression. For instance I would like to install all packages that has the prefix llvm-3.1, and I use: sudo apt-get install llvm-3.1* But zsh tells me that: ...
1
vote
2answers
2k views

Merge Excel rows from two sheets

I'd like to start this question by apologizing, there are numerous questions about merging excel rows, still, after browsing the web AND the list of "Questions that may already have your answer", I ...
3
votes
5answers
2k views

Using sed to remove digits and white space from a string

I am trying to remove the first occurence of digit(s), the dot, the second occurence of digit(s) and the space before the word. I have come up with this regex: sed 's/^[0-9]\+.[0-9]\+\s//' input.txt ...
1
vote
2answers
153 views

How do I list every other file extension using regex on Linux?

I have the following command which lists all files that have the extension .swf however I would like to return a list of every file that does not have the extension .swf find . -maxdepth 1 -regextype ...
2
votes
2answers
82 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?
3
votes
1answer
355 views

Notepad++ regex add lines, copy string

I want to search replace & strings in thousands of wavefront *.mtl files to add many new Texture links. Is this even possible with Notepad++ regex? I´ve already altered these files very often with ...
2
votes
2answers
154 views

OpenOffice Calc regex returns wrong value - what's wrong with my regex?

I have a column of text with values concatenated by my bank, as in a typical monthly statement. Here is an example (column A240): OCT 26 BALANCEPROTECTOR PREMIUM $10.05 I'm trying to set the ...
1
vote
2answers
84 views

Finding folders only

My harddrive is in a mess, so I decided to do a cleanup. As a part of this, I want to merge all folders containing music into one. What I want to do is, look for any *.mp3's and *.aac's on my drive ...
1
vote
1answer
77 views

Do not search in comments Visual C++ 2010

Somewhere in the code, I've forgotten std::cout<< which is now messing up my console. But my code us full of commented debug outputs and VC++ searches through all of them, making it impossible ...
-2
votes
2answers
214 views

“Replace all” using Regular Expressions in Notepad++

So I never actually used Regular Expressions in depth. I've got a config file consisting of thousands of lines looking like this: "Line 1"=18341235645 "Line 2"=123784571 "Line 3"=86273485 "Line ...
0
votes
1answer
222 views

Nano syntax highlighting malformed regex?

I found this javascript syntax highlighting file for nano on google code, downloaded it and included it in my /etc/nanorc file: File: /usr/share/nano/js.nanorc ## all *js files ( e.g. Firefox ...
0
votes
2answers
63 views

OpenOffice - Regex for reformatting line with word + numbers

I have a document with sections headed "Chapter 1"-"Chapter 45". I want to make them all caps and all in bold font by using a regex. I am stuck. I keep ending up with things like "CHAPTER "[0-9]" ...
2
votes
1answer
91 views

using grep -E with AND conditions (ex: (?=/fo)^(?=/mo))

I have little problem figuring out how to get a list of files that has: string "/fo" in it But does not have string "/mo" I'm trying to figure out that in folder with lot of text files... My ...
0
votes
0answers
63 views

How to replace file strings with regexp in Linux

I'm trying to replace the specific numbers and use this command: sed -e 's/[0-9]\{12\}/ /g' file.log but nothing happens. As U can see this expression should replace all numeric occurrences with ...
0
votes
1answer
854 views

Adobe Brackets; How to use the replace regexp function?

I searched the Brackets user guide @github and couldn't find how can I use the the search and replace function inside of the program. A simple example is to find foo and replace it with bar in a ...
4
votes
4answers
76 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 ...
0
votes
1answer
543 views

Replace numbers that start with a “-” (hyphen) in Notepad++

So I exported a mySQL database, so far everything has been easy to edit in Notepad++. However, every new line starts with a -123456 random number string. Is there a way to remove all string that ...
0
votes
1answer
132 views

Bash: Grep regular expression failing to work

When using grep like so: ps aux | grep 'processname' | awk '{print $2}' The PIDs of processes withprocessname is returned. When using this: ps aux | grep '^processname' | awk '{print $2}' I'm ...
8
votes
3answers
7k views

Find and Replace text between ^ and ~ in Notepad++

I have a large text file where I want to remove all text between the ^ symbol and the ~ symbol. This needs to work across lines as well. I tried doing a regular Find and Replace using ^*~ in the Find ...
2
votes
1answer
98 views

Vim delete lines that contain word A but not word B

In vim I need to find all lines that contain one word, but do NOT contain another word and delete them. I've seen plenty of :g, :g! and :v talk while trying to figure this out but nothing that gives ...
0
votes
1answer
98 views

Find matches to regex '[^,] which' in MS Word

I wish to Find instances of the substring [^,] which — the word which preceded by a space '' that is preceded by a character that is not a comma [^,]. Can this be done? The query [,] which works fine ...
2
votes
3answers
315 views

matching start of the line in cygwin regexp

I apply sed 's/^ bug*/__/' to ref bug bug ref and get ref __ __ ref The same is responded for perl, perl -ni -e 's/^ bug/__/; print'. Sample file can be downloaded ...
1
vote
1answer
400 views

Extended regular expression new line

I seem to match two things using extended regular expressions: Newline. I have tried [ \n], [ \\n], both don't work Negative lookahead for string "timeout". I have tried (?!timeout) Can anyone ...
0
votes
2answers
1k views

Notepad++ Search for a <tag> and match till the end of the line

I have some lines like: <itunes:author>XXX</itunes:author> <itunes:subtitle>YYY</itunes:subtitle> I need to remove for example the lines with itunes:autor tag. I ...
1
vote
3answers
2k views

Extract/delete all other text than whats inside “ ”, and after string

I'm have a very big data output in a .txt file that looks like this: value1="1",value2="2",value3="test3",value4="4" value1="1",value2="2",value3="anothertest3",value4="4" ...
2
votes
1answer
459 views

Parsing multi-line string to extract only matched lines

I have a multi-line string and I'd like to only extract lines that match a certain pattern and discard the rest of the string. Original string: lorem ipsum dolor sit amet consectetur nunc KEEP THIS ...
0
votes
1answer
25 views

Using the 'ed' editor, how can I print the first 20 matching lines?

Given a file of humongous size, I can edit with ed, then issue the following command. g/real/p Which will print out all lines containing 'real'. What I want to do is print the first 20. I know ...
1
vote
1answer
180 views

regex redirection to safe url

I have several thousand URL's in a CMS formatted like: /post/en/1539/A+Week+in+Paris+61.html I'm moving all of the data to wordpress. Where the URL structure will be formated as: ...
2
votes
2answers
432 views

Conditional spaces in a regular expression?

Using grep, how would I do this in one command line? I have this so far grep '\$[0-9][0-9]\.[0-9][0-9]' money.txt with various strings in the text file, but I'm having issues satisfying some of my ...
8
votes
1answer
317 views

How to make sed omit not matching lines?

In the following example, sed matches lines starting with an a or a c and prints the first character of that line (a or c): $ echo "ag bh ci dj ek fl" | sed 's/\(a\|c\)./\1/' # Matches lines starting ...
1
vote
4answers
850 views

Batch renaming of files using regular expression in Unix

I have several thousand files of the form: [8-digit number]_[number I want]_S60491_I129111.dcm. I wish to remove everything except the number I want, and use that as its name. In Ruby, I can get to ...
1
vote
2answers
101 views

Methods to remove acronyms from a document?

I have a friend who wants to learn how to remove replace all acronyms with their proper names in reports she compiles. She showed me a list she has written out and it's enormous. I would think there ...
0
votes
6answers
637 views

grep *.c not working

I have a list of ".c" (c files) in the current directory. I have to find all the .c files in the current directory. The command that can be used id ls *.c But, another way is to use grep. so if i ...
4
votes
4answers
5k views

rsync using regex to include only some files

I am trying to run rsync to copy some files recursively down a path based on their file name pattern, case insensitive. This is what I have done to run rsync: $ rsync -avvz --include ='*/' ...
0
votes
2answers
345 views

sed regex remove special characters

I have a file with several strings that come from an HTML formated text, so they have some HTML sequences that doesn't look good in a console interface. Here's an example: Text1&#8482; ...
0
votes
1answer
850 views

Why does the following find regular expression not work on Linux?

I am attempting to locate files that match a particular pattern however attempting to run the command below returns no results even though there are files that should match the pattern. find . ...
2
votes
5answers
509 views

Getting regex to match a filename

I have a script that lists a bunch of files that match a certain criteria. It outputs filenames only and there is a bunch of text that is unnecessary. An example string is: ...
1
vote
1answer
400 views

Add, replace or delete something/everything between two strings with regexxer

I'm using regexxer to translate an application that use .php files. In accordance to the webpage it's based on usage and syntax of Perl regular expressions. It looks more to be applied to Perl code. ...
1
vote
1answer
48 views

Automatic replacement of expressions

Maybe this can be achieved through (extended) regular expressions, but I really don't know if or how. There seems to be a way to access "things that are found" by using $1, $2, … but I have no idea ...
0
votes
2answers
668 views

Regex find-replace big file [duplicate]

Possible Duplicate: Is there a text editor for very big files? I need to find a text editor that can replace a regex in a 250MB file without crashing. I tried: EditPadPro NotePad++ Is ...
0
votes
1answer
436 views

Regular Expression Needed to Replace Javascript in HTML Files

I need a regular expression that works in Notepad++ to remove multiline javascript references in several hundred HTML files. The code I want to remove looks like this: <script ...