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
96 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
43 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
1answer
40 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
118 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
357 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
138 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
243 views

How do I use wildcards in Notepad++ to 'find and replace' all of this text?

I would really appreciate some help with this. I am working with a large corpus of text that has been marked-up with XML script and I need to tidy some things up. More specifically, there are several ...
1
vote
1answer
27 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
207 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
887 views

Delete specific number of characters after a specific string is found

I have several lines of code and I'm looking for a way to search for a specific string e.g. 'id0=' and delete it and all 10 characters after it, per line. I would prefer a way/macro/addon for ...
1
vote
1answer
72 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
547 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
714 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
30 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 ...
0
votes
1answer
25 views

Return / transform then return pattern with nulls

I'm using grep/sed to parse a large binary file full of nulls for some specific data. This is in a windows environment using gnuwin32. Assuming I had some to return some data from a binary file that ...
0
votes
1answer
26 views

Remove beginnings of email addresses from text using grep or sed

I have a text file with lines like the following: John Stevenson Johnnyboy34 john.stevenson@company.com 0320423\n Mike Anderson AndersMike mike@mikeltd.foo 0234234 How do I remove the "text" ...
0
votes
1answer
123 views

Find and replace using wildcard/regex characters in Notepad++

I have an HTML Code with the following structure: <td class="tar"> <div class="bubble in"> Some Text, I want to keep! And maybe even an image: <img src= ...
0
votes
1answer
57 views

Using Notepad++ search/replace PHP code with regexp

I don't have experience in regexp so I hope someone will able to help me to change faster than by hands Need to replace objects to arrays like $variable -> child; OR $variable->child to ...
0
votes
1answer
157 views

Microsoft Office 2013: Regular Expressions

I read the articles on RegExp in Office already. My wish is to manipulate quoted strings. I need to replace the quote characters with parentheses. For example: "Hello World." should be replaced as ...
0
votes
1answer
67 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
73 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
53 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
92 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
134 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
180 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?
2
votes
0answers
25 views

Getting RegEx Code for File Name Change

Good Day Please help to find the right RegEx or other code for changing file name. Many subtitle files I have unnecessary character. I need to rename in my expectation format. Here the example Raw ...
2
votes
0answers
489 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 ...
2
votes
0answers
555 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
31 views

LDAP role/group membership

We have many users registered in our LDAP auth. So far we've only stored login and mail-related information in this LDAP. In our main application (Play! Framework), we needed to modelise roles ...
1
vote
0answers
45 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
436 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
281 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
7 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
0answers
11 views

Upping all seconds of X value

I have a subtitles file. What regex should I use in Notepad++ to up every line of 2 seconds? 00:01:15,444 --> 00:01:17,613 should become 00:01:17,444 --> 00:01:19,613
0
votes
0answers
44 views

Multiline find and replace wrapper with wildcard inside

I'm trying to put a wrapper around a bunch of fields that already exist. I want to convert this: <div class="editor-label"> @Html.LabelFor(Function(model) model.FirstName) </div> ...
0
votes
0answers
27 views

RegEx formula for copying comma-separated target glossary terms to a new line

I have a tab-separated two columns glossary that contains mostly target, rarely source terms separated by a comma and followed by white-space like: abarbeiten-TAB-execute, perform and denken, ...
0
votes
0answers
21 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
50 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
66 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
41 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
98 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
53 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, ...
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
45 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
96 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
81 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
64 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
123 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
756 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 ...
-1
votes
0answers
22 views

2500 js files iinfected. Remove specific malicious code from them at once

I had an attack those days and my server's js files got infected. 2500 of js files have this code on top of them. I'm trying to use sed to clean those files from this code at once but I can't achieve ...