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
1answer
94 views

Windows program / tool needed for recursively searching through files referenced from within a file

Following scenario: I browse for unsafeMethodCall() in all my web pages. This method is only unsafe in case that there is a reference of doSomeCrazyAjaxStuff() My web pages are using strong ...
2
votes
1answer
35 views

make \w match characters like ÄÖÜäöüß?

Is it possible to customize the behavior of regex metacharacters for character classes like that? (In Sublime, or more generally.)
2
votes
1answer
108 views

Is there a way to do rich text formatting with regexes?

I'm trying to edit a large public domain text for publication. One of the things I have to do is make each paragraph's heading bold. Since the heading always begins with an open-paren and ends with a ...
2
votes
1answer
324 views

Using Notepad++ to search/replace PHP code with regular expressions

I would like to update some PHP code into the Joomla framework, replacing things like: $myvar=$_POST["myvar"]; with $myvar=JRequest::getVar('myvar'); This seems like it should be easy enough ...
2
votes
1answer
131 views

Command that behaves like Emacs' align-regexp

Let's say you have a properties file that looks like this: prop1 = value1 longerprop = value2 reallylongpropthathasnomeaning = val3 shorterprop = val4 and you want to "beautify" it into this: ...
1
vote
1answer
25 views

Is it possible to sed -i from a text file to another text file?

I'm coding a shell script on my Debian box and there's a line on the script that needs to delete some emails from a textfile that is full of emails, like this: sed -i ...
1
vote
1answer
179 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: ...
1
vote
1answer
69 views

Is there a way to detect regular expression support in a htaccess file?

I use to following rewrite rule to pass the whole url to an php script: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*?)$ ...
1
vote
1answer
500 views

Find/replace underscored words to camelCase words using regex?

I have a ton of text files that are tagged with underscore-connected words like @some_text, but I would like to convert those to tags in camel case, like @someText. How can I use regex (either in vim ...
1
vote
1answer
642 views

How does adblock regex work?

Here I found adblock regex explanation. I wish to block all images containing "bbelements" in their url, but neither "bbelements" nor "*bbelements*" worked for me. Surely it must be something very ...
0
votes
1answer
7 views

How to navigate PHP-based pagination with WGET?

I'm trying to come up with a list of possible names for our next baby boy and have been looking through the site IndiaParenting. Each name on the site has a detail page at a URL like this one ...
0
votes
1answer
32 views

Using regex to select word before another word which starts with a capital letter

I would like to select all adjectives in a German sentence. As all German nouns are capitalized, I though one way would be to look for capitalized words and select the previous word. If the selected ...
0
votes
1answer
26 views

Weeding out invalid html code with regex

I need a pcre regex that will select all html img tags without a src part. Long story. With help I got to (?-s)<img(?!.*?src).*?\/> which worked fine until a line got a second img tag WITH src ...
0
votes
1answer
28 views

using sed to replace 1 line with a multi-line variable in ksh

I have the following text in a file: XXXX NNNN YYYY NNNN ZZZZ NNNN I want to replace the NNNN to make it look like this: XXXX NNNN DUTY FORECASTER: YYYY NNNN DUTY FORECASTER: ZZZZ NNNN ...
0
votes
1answer
54 views

How to grep values under columns

How can I grep for a specific column name and display the value underneath that column. Sample data: StandByFile StandByPg StandByLSN StandByRcvBufUsed S0082160.LOG 621668 ...
0
votes
1answer
40 views

Vim experts: how to find a number within a range based on two numbers? Eg “777” matches “667:888”

I need to search for numbers in a text with Vim. The numbers I need to find are often within a range based on two numbers and I need to match that range based on a single number. For example, in my ...
0
votes
1answer
85 views

Find duplicate phrases - any tool or regex

I've got a long document, and I suspect that some phrases (one or multiple sentences) are identical or at least similiar. Is there some way to find these repetitive phrases? Some tool or regex?
0
votes
1answer
96 views

Notepad++ regex highlighting

I'd like to be able to highlight entire lines in notepad++ by keywords, but these keywords would be added in the end of each line. I tried with the available mechanism of "User Defined Language" ...
0
votes
1answer
44 views

How can I replace one Youtube URL pattern with another via FoxReplace?

Youtube changed its layout again. Now to get to a user’s uploads page you have to click on their nickname, then on the “Videos” tab, and then filter by uploads-only from a dropdwon menu. If you also ...
0
votes
1answer
47 views

To Search data in a given range in notepad++

I have data like this: ABC DEF 123 456 STU 567-89 XYZ 234 123 345 789 ERT FGHT TYUI FGHT 456 HHKHFS NOR TEST TEST1 5678 NOT TEST Trying to format it as below output in which I can use to ...
0
votes
1answer
47 views

How to join strings in the lines that ended with special string?

I have a text in this format: NP00000 Fp NP00000 Fp NP00000 Fp NP00000 Fc NCMS000 AQ0MS0 Fp NP00000 Fc NCMS000 ...
0
votes
1answer
47 views

How do I process this data with a regex in Notepad++?

I have a database dump, looking like this: ;i:23;s:18:"Product Name1";i:24;s:27:"Product Name2";i:25;s:15:"Product Name3"; [...] All I'd like to get in Notepad++ is this: Product ...
0
votes
1answer
57 views

linux find regex - can I use 'search', instead of match?

the find utility is powerful, but I'd need some additional features. its -regex search treats each filename (or dirname) as a string and applys given regex only at the beginning of name. like ...
0
votes
1answer
40 views

Application to do regular expression search on all pages linked to some specified html page

I am using a Windows 8 machine and starting with an html page I would like to automatically retrieve the text content from every link on that page that matches a regex. The retrieved content must then ...
0
votes
1answer
211 views

How to match regex for TLD?

I know there are lot of regex for the purpose, but in my case the regex i want to write is one that matches following payload ...............sssfdf.makememad.com...... ........makemadcom..... ...
0
votes
1answer
136 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
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
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 ...
2
votes
0answers
26 views

find using regexp and echo matches

I have about 50 users in /home/ directory and I have cloned a git repository to everyone: Executed at /home/ as root user: find . -maxdepth 1 -type d ! -name . -prune -exec git clone ...
2
votes
0answers
507 views

LogRotate use regex for filename

I have a custom logging class that creates a log for each instance of the process and adds a unique id to the log file name, example: process.1234.log process.1235.log Also I can add a date/time ...
1
vote
0answers
52 views

Nginx rewrite to remove first (generic) path node

I am currently writing a dispatcher that will dispatch different URLs to specific service URLS. I essentially want to dispatch something like: POST ...
1
vote
0answers
41 views

TextAnalysisTool.NET equivalent for OS X

I've used TextAnalysisTool.NET in the past for analyzing log files on Windows machines and found it incredibly useful. I love the simplicity+power that it achieves for dynamically grepping log files, ...
1
vote
0answers
40 views

Script to port specifc data from doc1 (notepad++) to specific place(s) in doc2

I really appreciate your help with a windows script or regex function that ports specific data from doc1 (xml in notepad++) to specific place(s) in doc2 (notepad++). I'm running win8. Thank you in ...
1
vote
0answers
372 views

Midnight Commander copy/rename with replaced characters

I would like to copy/rename (F5/F6) with regex (regular expression) mask all the tagged files or directories with names containing space or á or é characters replaced with underscore and a and e ...
1
vote
0answers
254 views

Changing puttyTRAY's URL regex in order to match URLs across lines separated by tmux window boundaries

I use puttytray to access a shell account on which I have a tmux instance running. Inside tmux, I have irssi running in a window. When people post long URLs in IRC, however, it's annoying since these ...
0
votes
0answers
8 views

mRemoteNG Panel equal to Name

I wanted to have the Panel=%name% or something similar in mRemoteNG. Is it possible to do this within the program? For now I resorted to using Regex find replace in an editor on the confCons.xml file, ...
0
votes
0answers
16 views

How to define new scopes using arbitrary delimiters in Sublime Text 2

TL;DR: How do I bring Ruby-like comment scope to plaintext files for sublime text? I want to customize my plaintext file look in ST2 by allowing comments. So far I have managed to extend the ...
0
votes
0answers
29 views

Can I apply a regex to file filter on Notepad++?

I have a folder full of xml files, and I want to search through them for a particular ID. However, I only want to search the files that are of the format hello_apple_01.xml, hello_apple_02.xml... ...
0
votes
0answers
26 views

How to identify tab delimited columns in Multitail

I'm trying to remove certain columns from my logs, where columns are delimited by tabs. Here are some ways I've tried to remove the second column which didn't work. multitail -kc " " 2 my.log ...
0
votes
0answers
23 views

Apache mod rewrite testing tool (no online tools)

I've tested some great RegEx standalone tools and found a couple of mod rewrite online tools, but is there some standalone tools for testing apache mod rewrite definitions? Ideally, I want something ...
0
votes
0answers
59 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
0answers
26 views

Looking for a solution to discover common text patterns in multiple strings

I'm looking for a solution where I can examine thousands of strings that share some similarity and have it discover appropriate regex pattern(s) that will give a 100% match on all strings? The catch ...
0
votes
0answers
22 views

TextWrangler 4.5.3 (3310)

I've got a huge batch of XML that has an element order problem, and instead of writing XSL to correct the import, I wonder if I can reorder the elements within TextWrangler? I need to select the ...
0
votes
0answers
39 views

Match the First Occurrence In Text Using Boundaries

I need some help as I have been trying to figure this out all night. I need to match the first occurrence in an article. Something like this... The online marketing game has changed since the ...
0
votes
0answers
45 views

Regex: find words, which were “mentioned” before

Example of file, where words "re", "urllib" mentioned at text start (after keyword "import"), and at text middle: import re import urllib test test regex = re.compile(r'href="([^"]+)"') data = ...
0
votes
0answers
65 views

Emacs rx semantics

I have the constructed the following regular expresion using rx.el module (rx (and bol (0+ (not (any "#" "[]*" "\n"))) " " (or "#" "[]*") " ")) I want to change the string []* for the string ...
0
votes
0answers
75 views

Firefox Extension To Save To Folder Named After Text On Webpage

I am wanting to find or create a Firefox Extension that can create and save to a folder, based upon the text in a page's tag. I would want it to do the following: Check the page's html for a ...
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
0answers
119 views

XML text transformation

I have a large file part of which is like below: <DataGroup xsi:type="ReportDataGroup"> <SmartReportTemplate DescriptionContentType="text/plain" IsActive="true"> <Name ...
0
votes
0answers
564 views

Regex to find a string in GrayLog2

I am trying to find a regex that will search for a string in Graylog2: access denied For example, I want to search for the string: Login failed: Access Denied I have tried: \Qaccess ...