Questions tagged [regular-expressions]

107 questions
1
vote
2 answers

PowerShell Regex for validating DOMAIN\username

I have the following regexp for validating Windows usernames in a PowerShell script. $fqusername -imatch '^\w+[\\]\w+$' This works fine in my own environment, but I am planning on releasing it for wider use, and want to make sure it validates…
dunxd
  • 9,482
  • 21
  • 80
  • 117
1
vote
1 answer

Firewall blocking files using Reg_Ex needs to be adjusted

We have security in our firewall to prevent SQL-Injection from destroying any of our content: Name Type Context Severity Pattern Configure CS:select_into signature http-url critical .*\[select\].*\[into\].* Edit Remove CS:select_from …
Younes
  • 135
  • 5
0
votes
1 answer

Why my Fail2ban regex doesn't find matches?

I have tried many regular expressions in fail2ban config, but it never return any matches. Line example: [2019-12-10 10:45:38] NOTICE[15077] res_pjsip/pjsip_distributor.c: Request 'INVITE' from '' failed for…
0
votes
1 answer

fail2ban filter for ical regex

i am trying to get a regex for an ical service on my host working without success. This is a part of the logfile: Tue Jul 23 13:55:23 2019: ical|T720] [info ] Accepted connection from [::ffff:2.3.4.5]:56450 Tue Jul 23 13:55:23 2019:…
icey
  • 3
  • 2
0
votes
0 answers

Add rule in .htacces only if domain name begins with

I have to add a rule in a server that host many sites. This rule must be added only in those .htaccess files that belongs to a site with domain beggining with "dev-" or "review-". I have…
0
votes
1 answer

Ansible replace. Replace part of the regular expresion

I create a playbook that will harden my linux servers. Part of the process is to replace the umask in the default profiles. So, I have created this task: - name: Change the umask for default profiles replace: path: "{{ profile_file }}" …
Peter
  • 802
  • 2
  • 10
  • 23
0
votes
3 answers

Logstash Grok Parsing Failed

I need to match this entry 2015/10/30 23:58:21 pid 22223 testuser@testserver.example.com 192.168.0.1 [p4/2012.2/LINUX26X86_64/536738] 'test-monitor show' To match this I wrote this Regex P4_DATE…
Prashant Lakhera
  • 683
  • 1
  • 9
  • 25
0
votes
2 answers

Regular expression for second and third domain level with hyphens

I have some smart script, that check name of server and get domain name. For example, i have name of server: example.ru01. I need to get: example.ru My scipt: #!/bin/bash hostname=example.com01 echo…
0
votes
2 answers

Doesn't work regular expression for domain with hyphens

I have some smart script, that check name of server and get domain name. For example, i have name of server: example.ru01. I need to get: example.ru My scipt: #!/bin/bash hostname=example.com01 echo…
0
votes
1 answer

nginx location regex not working

I'm trying to setup location directive to match my request but can't get it working. Below is my sample request: /APP/public/api/v1/item/100/type location ~* ^/APP/public/api/v1/item/(.*)/type { try_files /APP/data/type/$1.json…
0
votes
1 answer

regular expression to match condition of character if exists should always be followed by a pattern

I need a regular expression with the condition that ..if there is an occurrence of character | one time ;the pattern immediately following is ARGS or URL For example abcd ab|ARGS cd|URL etc is valid abcd| ab||ARGS ab|cd etc are invalid (should not…
Anoop P Alias
  • 347
  • 4
  • 7
0
votes
1 answer

How to escape pipeline char in Windows shell?

I need to specify a regular expression that includes | character to findstr command: processtext.exe | findstr /R "Hello|Bye" How do I escape it? \| does not work. Quotes fix issue with pipelining but the regex does not match although separate…
UserControl
  • 135
  • 1
  • 6
0
votes
1 answer

Manage several sub domains with nginx

I like to handle different sub domains in my Nginx server, this is my config file (partially) server { listen 80 default_server; listen 443 default_server ssl; include …
DomingoSL
  • 335
  • 1
  • 4
  • 12
0
votes
2 answers

How to exclude a certain string in a search pattern

There are several exception messages in catalina.out file of tomcat server just like - java.lang.NullPointerException org.springframework.beans.factory.BeanCreationException java.lang.RuntimeException java.io.FileNotFoundException We want to…
0
votes
2 answers

Zabbix doesn't update value from file neither with log[] nor with vfs.file.regexp[] item

I am using Zabbix 2.2. I have a very specific environment, where I have to generate desired data to file via script, then upload that file to ftp from host and download it to Zabbix server from ftp. After file is downloaded, I check it with log[]…
tymik
  • 378
  • 2
  • 4
  • 16