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

How to open extension in Visual Studio 2010

I have installed two extensions in Visual Studio 2010. Regex Tester Regular Expression Tester Extension Both extensions installed successfully. I restarted Visual studio. But I don't see them. I ...
0
votes
0answers
23 views

How to pipe regex with ffmpeg and perl?

So I am trying to get the current frame of the conversion with this bash command: ffmpeg -i fd.mp4 fd.avi < /dev/null 2>&1 | perl -015 -e 'print <STDIN>=~/frame=(\ {3})(\d+)/' | sed ...
1
vote
1answer
37 views

Notepad++ find between lines

I would like to find out if there are "duplicate" text-fragment between two specific lines. For example i would like to find out that in the first "TestMethod" there is twice the "TC.Requirement" ...
3
votes
3answers
21 views

Regular Expression: how to match 'ab','ac' and 'a'

Now, I have three strings to be matched by a single re -- 'a', 'ab','ac' I suppose one correct re should be 'a[bc]?', but it seems not correct. What is the correct one? I try it in grep command. And ...
1
vote
1answer
40 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 ...
1
vote
1answer
29 views

Unable to match using regex negative lookahead?

I want to match the following string using regular expressions in Java: suspicious url test' xts#dfd I don't want the regex to match if there is a quote, (') This is what I'm using. suspicious ...
-2
votes
1answer
34 views

Grep word in one file, and use that word to match in another file, adding the thing that follows the match

I want to grep several words in file1, and use each word to grep what follows after its match in file2. And then I want to add the string that followed the match to the word I used into file03, so ...
1
vote
2answers
40 views

vim submatch - trying to put quotes around a string

I'm trying to use the vim submatch command to put quotes around all strings of characters in a line of text, and it doesnt work. Here's what I'm doing :s:\a*\a:\(submatch(0)\):g All it does is ...
0
votes
0answers
10 views

Tweak a long regexp to improve SASS support in Coda 2

this is more a regexp question than a Coda one. I have to tweak this regexp in a Coda language configuration file in order to see the actual names of @mixins (or similar) in the code navigator. I ...
0
votes
1answer
23 views

unclear as to what submatch does in vim

Im unclear as to what the submatch({nr}) expression in vim does. The manual says the following: submatch({nr}) *submatch()* Only for an expression in a |:substitute| command. ...
1
vote
0answers
45 views

How can I search gmail for a windows activation key? [migrated]

Somewhere lost in my gmail is a windows key. It's by itself in an email but I cannot find it. It's formated like so: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX If gmail supported regular expressions it would be ...
3
votes
1answer
48 views

Microsoft Office Word 2010: How to “Find and Replace” an entire line using “regular expressions” (wildcards)?

I would like to "Find and Replace" entire lines in Microsoft Office Word 2010 which match some criteria. I tried to find the solution in the official documentation, but I didn't find the answer: ...
0
votes
0answers
20 views

Remove every second carriage return starting from line two

I have a text file where I'd like to remove every second carriage return starting with line 2. So the carriage return should be removed in lines 2, 4, 6, etc. The carriage return can is ...
0
votes
0answers
21 views

Matching html paragraphs with at least one word in all caps

Using regex or anything, I need to match any paragraph which contains at least one all caps word. Then transform it into a header and capitalise all the content of the title. In the example below, ...
0
votes
0answers
18 views

Dreamweaver REGEX problems

Can anyone tell me the Dreamweaver Regex code to remove all functions in entire site named randtxt() regardless of the text in the quotations on the case 0-3 lines? function randtxt() { ...
0
votes
1answer
34 views

NOTEPAD++ REGEX - I can't replace what I find with nothing

Here is my regex statement which works great and highlights what I'm looking for in notepad++ (?<=thd)(.*)(?=]]><\/g_n>) But when I try to replace it with nothing aka an empty line or a ...
1
vote
1answer
19 views

Gedit gktsourceview3.0 rules - multiple optional suffixes

I'm trying to write a syntax highlighter rule for arm assembly to use in gedit. In arm, every command has some optional suffixes which make it execute conditionally. So obviously I want the command ...
0
votes
2answers
29 views

How to grep a number following a keyword from a textfile?

How to grep the member id X01930 from the following file? Blah Blah ... Blah Blah Blah Blah ... Member ID: X01930 Blah Blah ... Blah ... Blah Blah ... Blah The string Member ID: is usually there, ...
0
votes
1answer
26 views

vim search for strings in bracket

I have bunch of strings like this: [some_strings_in_square_bracket]$ some_strings_not_in .. [some_strings_in_square_bracket]$ some_strings_not_in .. [some_strings_in_square_bracket]$ ...
2
votes
3answers
54 views

regex help - ignore a char if it's in quotes

We have a web-based app at work where you can enter a regex into a search box and it returns the matches from a database Here's a sample of what the database entries might look like. They're comma ...
3
votes
2answers
46 views

Prefix all lines with the first word in a file

I want to prefix all the lines of a file (except first line) using the first word in a file. Input: x.o: x.cpp /u/a.h /b.h \ /c.h \ output: x.o: x.cpp /u/a.h \ x.o: /b.h \ x.o: /c.h \ Can ...
0
votes
2answers
44 views

how to parse watch command output to last 5 digits?

From the command watch -n1 "ifconfig eth0 | grep GiB" I have given the output below. Now i just want the last 5 digits before (GiB). I wrote an regex for it, and it seems to work ...
0
votes
2answers
44 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\'.*$' ...
0
votes
1answer
34 views

Is there a way to filter out filenames from vim's “oldfiles”, perhaps using a pattern?

I use vim's :browse oldfiles a lot to edit files I've recently worked with. However, there are some files, such as git's auto-generated COMMIT_EDITMSG, which clutter that list and which I never need ...
0
votes
2answers
53 views

Regex for unix paths

What would be the correct perl regex for detecting only Unix paths? ./dir1/dir2/file.ext - invalid ./dir1/dir2/ - valid ./dir1/dir2 - valid
0
votes
1answer
29 views

How can I use lookahead and lookbehind regular expressions on Linux using find?

I generally use the following command to match patterns find . -maxdepth 1 -regextype posix-egrep -regex '.*/{pattern}' However when I attempt to use a lookahead for example, no results are ...
0
votes
3answers
56 views

How to extract the first N words of each paragraph in a text? [closed]

Could you please tell me how could I extract the first N (e.g. 30) words of each paragraph in a text? Maybe with a regex?
0
votes
1answer
53 views

Notepad ++ FIND/REPLACE Regex Wildcard

I have a text file with a list of filenames like so. ABC-FS01-E-20110515045349.txt I am trying to find a way in Notepad ++ to parse it like the following. ABC-FS01-E-2011-05-15 I've tried using ...
1
vote
3answers
85 views

Linux GUI Regular Expression File Renamer (with substitution)

I have folder with several hundred files named like this: 010203.txt I want to rearrange the file names so that last two digits are moved to the front like this: 030102.txt I want to avoid writing ...
0
votes
1answer
31 views

Search files for regex and return which files contain matches

I searched everywhere but didn't find out how to return a file content that matches given words or a regex. cat /tmp/*.txt | grep "strings"
-3
votes
1answer
54 views

Use regular expression to look for “%” [closed]

I'm programming in Java and I want to use regex to look for any data with a percent sign, e.g. 10%, 20%,30%,etc. I've tried a.matches("%")but that only returns true if the string matches exactly the ...
0
votes
1answer
53 views

How to find and replace an entire line (random last 40 characters) with notepad++ using regex?

I need to replace something like this: userPassword: {SSHA}hLPcGtsS+sUhwlYq/23dsECuRGsvJj59OQXXJQ== with something like this: userPassword:funkypassword I have tried some random stuff I've ...
0
votes
4answers
92 views

Regular expression to find senders IP using grep or other languages

I have input file that contains: 19:04:01.631948 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 48) 181.173.82.61.1985 > 250.66.33.195.1985: HSRPv0-hello 20: ...
0
votes
0answers
17 views

Chrome extension that would remove some part of the HTML document based on comment? [duplicate]

I need to cleanup some forums and the normal AdBlock doesn't work because the only way to identify the section to be removed is to look inside the HTML and remove the part between the comments (this ...
1
vote
0answers
36 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
93 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
46 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
58 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 ...
0
votes
0answers
42 views

Notepad++ command to tweak document path and filename

In Notepad++ 5.8.6, is there a way to copy to the clipboard the current document's full path and filename after applying a regular expression replace? For example, I can do Edit > Copy to Clipboard > ...
0
votes
1answer
35 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
56 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
34 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
67 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
49 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
57 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: ...
2
votes
4answers
92 views

Text Editor Software that support Unicode RegEx

Is there any Windows text editor software that support Unicode Properties, Scripts and Blocks feature of RegExp (You can type in it: آرد and search for \p{Arabic} to see if a software support that). ...
1
vote
2answers
118 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
270 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
66 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
3answers
64 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?

1 2 3 4 5 9