When asking regex questions, always add the tag for the specific programming language or tool (e.g., Perl, Python, or Java; vi, emacs, or ɢɴᴜ grep; etc.) you are using.

learn more… | top users | synonyms (1)

-1
votes
3answers
2k views

Trouble Letting Users Get to Certain Sites through Squid Proxy [closed]

We have Squid running on a RHEL server. We want to block users from getting to Facebook, other than a couple specific sites, like our organization's page. Unfortunately, I can't get those specific ...
0
votes
7answers
2k views

Is it possible to have regular-expression CNAME record in DNS?

Is it possible to do something like this? Or any equivulent? in a DNS server. ([0-9]{2}).mydomain.com. IN CNAME www$1.other-domain.com.
1
vote
1answer
2k views

replacing a line or date in a text file using powershell

I am trying insert today's date on a text file at line 59. How do i do this? Line 59 has like 30 spaces and then reads like this. After the PowerShell script runs it will change the date so it has to ...
0
votes
2answers
341 views

Need custom Nginx regex

Following is what I have right now and it works but needs some improvement. I am guessing that I will need to use regex and that is why I need help. What I need is this ...
0
votes
1answer
157 views

Apache redirect to another domain all URLs, except for ones starting with substring

Can anyone help me achieve a redirect in Apache from http://subdomain.example.com/ to http://example.com/ for all URLs, EXCEPT the ones starting with "files/"? Thank you
3
votes
2answers
3k views

How can I route some emails to a script in Postfix?

How do I route all emails directed to user-*@example.com (i.e. user-1234@example.com) to a pipe command in Postfix? The idea is to create craigslist-style anonymization by assigning dynamic email ...
2
votes
2answers
3k views

nginx location regex matches directory range

I am trying to set up nginx and I don't get the point how to do the following setup: I have an URL http://somehost.com/foo/bar/123/xxx_xxx that needs to be passed to different backends depending on a ...
1
vote
1answer
719 views

Nginx - Redirect request by GET parameters pattern

One of my servers was attacked by DDoS a couple of days ago and it lasted for 4 days. Below are the logs snippet of the request: 36.224.180.253 - - [14/May/2013:03:11:46 +0800] "GET ...
1
vote
2answers
293 views

Why do two patterns (/.*) and (.*) match different strings?

Shouldn't the two patterns (/.*) and (.*) match the same string? My real question is actually: where did the "abc" go? Something funky seems to be happening inside the mod_rewrite engine... Given ...
0
votes
1answer
3k views

Grep date with regex

I have files with lines in the following formats: . . . 12/16/09 17:56:30.211 rest of line... . . . 12/17/09 05:34:10.809 rest of line... . . How do I grep the lines out of this file that are ...