Questions tagged [regular-expressions]
108 questions
0
votes
1 answer
Need regular expression + Apache help urgently!
I want staging.mywebsite.com to point to the staging virtual host, for the live I want mywebsite.com and www.mywebsite.com to point to the live one etc., and then for *(everythingelse).mywebsite.com needs to point to the development server.
Anyone…

Walker
- 103
- 4
0
votes
1 answer
I am trying to write an htaccess file performs authentication and redirects authenticated users to authorized directories. Can anyone help me with the condition syntax?
This is what I have so far but I can't get the RewriteCond and RewriteRule properly.
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (\d{3})$
RewriteRule !^%1 http://subdomain.mydomain.com/%1 [R,L].
AuthName "My Domain Protected Area"
AuthType…

user41157
- 189
- 2
- 9
0
votes
1 answer
Regular expression does not work in EMEditor
I have a simple Regular expression to select all text between X-Mozilla-Status and [Chat Info]. I tried it at https://regexr.com/, and it all works great. However, it can't find anything if I add it to the find area in EMEditor and search my…

TAPIO
- 1
0
votes
0 answers
Testing Regular Expressions
I am trying to learn regular expressions, and came across some examples online. Trying to put things together, I inputted this into bash
^(([a-j][a-j]?)|(3[a-j][a-j])$
It returns the following error
bash: !!: event not found.
Why do you believe I…

Smokefox
- 1
- 1
0
votes
4 answers
non greedy grep command on ubuntu?
I'm building a script which filters out all our translatables from our template system.
the problem i'm facing is the occasion where 2 translatables are on one line.
These are 2 example lines from a template file which both hold one or more…

ChrisR
- 262
- 3
- 13
0
votes
1 answer
Postfix test: I can't forwarding outgoing emails
I am configuring a Postfix server in a test environment. It can only forward local emails. Outbound email must be redirected to /dev/null or to a local account. I found a solution on your forum but it unfortunately does not work properly.
I do not…

jacobi
- 1
0
votes
1 answer
Postfix header_checks add X-Mailgun-Tag
I am trying to add in the postfix header_checks, using PREPEND, some X-Mailgun-Tag headers.
When using the following expressions in the header_checks, it applies without issues to all domain emails.
/^From:.*@example.com.*/i PREPEND X-Mailgun-Tag:…

Nikos Klavdianos
- 11
- 2
0
votes
0 answers
Regular expression for location with slash at the end
I have location
location ~ /(apple|club|car|fly|fitness|nivea|nesquik) {
alias /srv/static-pages/$1.html;
}
I tried
location ~ /(apple|club|car|fly|fitness|nivea|nesquik)(\/)* {
alias /srv/static-pages/$1.html;
}
But it nothing gives…
0
votes
1 answer
Regular Expression in EMEditor
I am trying to make a simple find > replace regular expression. This does work fine in https://regexr.com/ to find this comment below. However the editor I use is EMEditor that i try to make a find and replace trough files and subdirectories.…

TAPIO
- 1
0
votes
1 answer
Nginx isn't passing on the last forward slash of an arg to a script
Have an issue where nginx isn't passing on the last forward slash of an arg to a script
Example
https://xxxx.com/test_t/company/Default/icon_category/Hotel.png
Rewrite:
location / {
rewrite…

Viet Le
- 1
0
votes
1 answer
Find and Replace using Regular Expression
I try to find a way to find and replace using EMEditor and a Regular Expression. I try to applu this for the item below:

Thom
- 41
- 1
- 3
0
votes
1 answer
Regular expression to find content that is sandwitched between 2 symbols
This might have been asked before but I cant find a solution. I am looking for a simple "Regular Expressions" search pattern to find something in my PHP files.
I am looking for the following pattern

Thom
- 41
- 1
- 3
0
votes
2 answers
Find with regex not working on CentOS 7
I have problem with find and regular expression. I would like to find files in /etc, which name begin of a or b. I tried this commands:
find /etc -type f -regex '^a'
find /etc -regextype sed -regex "^a"
find /etc -regextype egrep -regex '^a'
find…

PawelC
- 149
- 1
- 11
-1
votes
1 answer
validate file content with bash Regular Expressions + Linux
how to validate the following file content
that should be include single integer/float number
by bash Regular Expression or any other idea with awk/sed
cat /var/VERSION/Version_F35_project_usa
2.8

jango
- 59
- 2
- 3
- 12
-1
votes
1 answer
sed + replace value default in grub.conf
I want to change the default value on all machines to default=0
default value could be any integer number
how to set in the sed syntax that default could be any number
my example ( not working )
for server_ip in $all_servers
do
ssh $server_ip…

dandan
- 1,081
- 4
- 13
- 21