Questions tagged [regex]

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.

720 questions
2
votes
2 answers

How do I generate a regex to restore a specific folder for "btrfs restore"?

I am trying to recover files after a crash of a btrfs filesystem using: btrfs restore --path-regex 'regex' -sv -D /dev/sdXX /mnt/destination for example, to retrieve all files in /snapshots/@_2018-06-01T23:29:33-04:00.preupgrade/ I tried following…
rick
  • 21
  • 1
  • 2
2
votes
1 answer

Apache Redirect based on directory match & Add another letter to the destination URL

So here’s what I’m trying to accomplish. I have this link, I want to 301 redirect: Origin…
Ja Hi
  • 23
  • 2
2
votes
1 answer

Regular expression to restrict URL in HAProxy

I had successfully restricted an URL in my web app to certain trusted IP, using below-mentioned config in haproxy config acl trusted-ip src -f /etc/haproxy/whitelist.lst acl protected-page url /abc /abc/ acl allowed-page url…
Arjun K R
  • 23
  • 1
  • 3
2
votes
1 answer

Which special characters work in sieve regex?

I have the Roundcube Webmail v. 1.3.1 mail client with managesieve v. 8.7 extension and want to add some regex driven actions for my mail and the only documentation I found on the regex flavour is this document. However I can't find which special…
VaNa
  • 137
  • 7
2
votes
2 answers

regex sieve script not matching

I have a problem on a dovecot2 mail server with a sieve script I write. The script should automatically move mail coming from a mailing list to a folder (by list name, not list id) require ["fileinto", "mailbox", "variables", "regex"]; if exists…
M1k3y
  • 19
  • 5
2
votes
1 answer

Proxy websocket with parameters through proxypass/proxypassmatch without a VirtualHost

I have been trying for the longest time to proxy a websocket with it's sid variable to the localhost service, that is serving it. I have looked far and beyond for a solution (including a lot of the questions here), but most of them suggest to use a…
smsimeon
  • 21
  • 2
2
votes
1 answer

Nginx local proxy - upstream wildcard?

If browsing web.dev/test2, it will look into /var/www/testsite/test2.local/public. All done through local proxy. Below rewrite running perfectly for test2 only: upstream site.local { server 127.0.0.1; } server { server_name web.dev; root…
Isak Pontus
  • 47
  • 1
  • 9
2
votes
0 answers

Apache RedirectMatch for SSL allowing LetsEncrypt not working

I've been trying to use Apache RedirectMatch to send most requests to SSL, but still allowing the Lets Encrypt challenge to work: RedirectMatch permanent ^/(?!\.well\-known/acme\-challenge)(.*)$ https://example.com/$1 This redirects the bare…
mbrampton
  • 311
  • 4
  • 12
2
votes
1 answer

Multi-line PCRE w\ lookhead, count matches

I am trying to perform a regex that matches if both the word cat AND dog are in the regex with multi-line support matches cat asdjfaldsfj dog #### does NOT match cat adfasdf8989 #### matches dog adlsjf88989 cat #### matches cat asdf8a89sdf8 a…
SquidZ00
  • 21
  • 2
2
votes
3 answers

AWStats ignore all but one sub directory

I'm using AWStats and I want to ignore everything in a subdirectory except for a particular directory, here is the directory layout: Webroot -dir_1 -dir_2 --subdir_a --subdir_b --subdir_c ... I want to run statistics for everything in the web…
Brian Fisher
  • 641
  • 3
  • 10
  • 15
2
votes
1 answer

PowerShell - Select(or regex for) words that ends in .story

I am trying to extract from some notes, words that ends in .story. This words are always placed into some links such as bla:///bla/bla/bla/.../word.story. The notes may contain multiple links and the format of these notes may vary but there I will…
pandoJohn
  • 415
  • 1
  • 5
  • 8
2
votes
1 answer

How to signal the presence of a pattern via exit code, without altering STDOUT

I need to run cmd1. If and only if PATTERN is missing from its STDOUT, i need to run cmd2 too: cmd1 | grep "$PATTERN" || cmd2 But I'd like to see all output from cmd1, not just the lines that match PATTERN. I know I could do something like…
Nils Toedtmann
  • 3,342
  • 5
  • 26
  • 36
2
votes
1 answer

Understanding IIS 8.0 Rewrite inbound rule for https to http redirect using regular expression

I have managed to configure a rewrite rule for my web site using this answer:
Alexei
  • 202
  • 3
  • 11
2
votes
2 answers

Using FilesMatch to target ALL files

I've tried unsuccessfully to use the Apache FilesMatch directive to process all files as PHP. Using this , I'm able to process specific file extensions as PHP, but I'm unable to find a directive that encompasses all file types,…
Ralph
  • 862
  • 11
  • 26
2
votes
1 answer

HAproxy is giving me problems with regex replace, Is this a bug or am I doing something incorrect?

I am attempting to correct a URL parameter issue by forcing a URL encode on a node of a POST path that is somewhat a frequent occurrence. It seems best, at this time, to fix this at the proxy layer until a better solution has be developed.. but…
rhaag71
  • 123
  • 1
  • 6