New answers tagged regex
1
vote
Odd behavior of bash array
Took me a while to get back.
If you don't declare it as an associative array then it's a numerically-indexed array for which the index part is treated as an arithmetic expression. In an arithmetic ...
- 4,410
0
votes
Accepted
Redirect all URLs ending in ".-detail" to remove the dot
RewriteRule ^$.-detail https://www.example.com/$1-detail [R=301,L]
There are few issues with the regex:
The $ (end-of-string anchor) is in the wrong place. This should be at the end of the regex (...
- 12k
0
votes
Accepted
RegEx for 301 redirects to change path AND remove a string
You can try this:
/components/com_mijoshop/opencart/image/cache/(?'path'.*)-365x365.jpg /wp-content/uploads/nc/[path].jpg
- 35.7k
0
votes
Extract repository name from GitHub url in bash
A slight modification to @Hicham's answer
^(https|git)(:\/\/|@)([^\/:]+)[\/:]([^\/:]+)\/(.+?)(\.git)?$
Will extract out the .git suffix as well.
Top 50 recent answers are included
Related Tags
regex × 705nginx × 226
apache-2.2 × 70
rewrite × 65
fail2ban × 62
.htaccess × 54
mod-rewrite × 49
linux × 43
bash × 37
redirect × 34
postfix × 33
regular-expressions × 33
apache-2.4 × 31
grep × 28
sed × 21
haproxy × 18
logging × 17
url × 17
ansible × 14
php × 13
web-server × 13
perl × 13
apache2 × 12
lighttpd × 12
awk × 12