Category "regex"

What is the best practice using KQL to filter desired attack signature over (web)logs?

Recently I'm experimenting with logstach and Kibana on top of elastic over (web-)server logs. I tried to extract some attack signature like XSS & SQL inject

JavaScript - How to extract strings - keys/values from response using RegEx?

I am very new to regex, and I want to extract some data from API responses. I have a response from my API call: { server: 'nginx/1.21.0', date: 'Mon, 25 Apr

Python how to split a single string in a list, into various strings by splitting it with multiple delimiters

I am writing a program for a calendar and in a specific function, I have to add/delete a calendar event. In my delete_event function, I am taking the already gi

Intermediate Algorithm Scripting: Search and Replace

Question Perform a search and replace on the sentence using the arguments provided and return the new sentence. First argument is the sentence to perform the

Avoiding Redos Attacks

Using regular expressions is a little bit tricky especially in Node.js applications. Because It can cause REDOS attacks. I thought that maybe running all regula

How to grep a string ending in a specific punctuation mark

I'm trying to grep strings that end in a dash in R, but having trouble. I've worked out how to grep strings ending in any punctuation mark, maybe not the best w

Regular Expression that return matches specific strings in bracket and return its next and preceding string in brackets

I need to find the string in brackets that matches some specific string and all values in the string. Right not I am getting values from a position where the st

Discord username format check

How can I check if the username is in the right format? For example in this format: Test#1234 And not check more than 4 numbers after #. How can I do that?

How to Restrict or Remove Emojis or Emoji-cons from Textarea on Input box using JavaScript and Angular4+

Here I want to post my Answer of the above question because the same issue I was facing but didn't find complete answer. After doing R&D, Mix and merge vari

Vim Regex Negative Look Arounds and Capture Groups

Say you have the following text foobar bar And you want the following as your desired output foobar foobar You could use the following regex s/\v(foo)@<!(b

PowerShell - Inserting newline char in string during regex replace

I'm trying to search a string for some numbers and insert a new line before each, not including the first one. I don't seem to be able to use the traditional r

Hive SQL regexp_extract (number)_(number)

I'm new to hiveSQL and I'm trying to extract a value from the column col_a from the data df which is in this format: \\\"id\\\":\\\"101_12345\\\" I only need to

Ignoring Django Migrations in pyproject.toml file for Black formatter

I just got Black and Pre-Commit set up for my Django repository. I used the default config for Black from the tutorial I followed and it's been working great,

REGEXP_EXTRACT in Impala

I am trying to figure out how to extract customer ID from string that looks loke this: {"param":"success","value":"10","level":"0","error_code":"101","customer

Matching regex for text entry in Qualtrics (JavaScript)

In an open text entry question on Qualtrics, I am adding a validation using regex ("match regex" condition). I would like to only accept answers that include at

vee-validate regex not working

I need to validate US phone number XXX-XXX-XXXX using vee-validate with this basic regex: (?:\d{3}-)\d{3}-\d{4}. The regex works fine by itself, but does not w

Better way to remove HTML tags in Oracle SQL

I have a comments column and the comments added to release are stored as rich text in comments column. Now i'm trying to process this data and get an human read

Regex for DateTimeOffset validation in url?

How to validate the date and time in the url that is the correct DateTimeOffset format? DateTimeOffset format (basically starts with 4 digits of year and end wi

Regex to validate date formats dd/mm/YYYY, dd-mm-YYYY, dd.mm.YYYY, dd mmm YYYY, dd-mmm-YYYY, dd/mmm/YYYY, dd.mmm.YYYY with Leap Year Support

I need to validate a date string for the format dd/mm/yyyy with a regular expresssion. This regex validates dd/mm/yyyy, but not the invalid dates like 31/02/45

can we customize link detection in VSCODE's integrated terminal

VSCODE can auto-detect links in the integrated terminal as below. Can it be customized? Ex: All email IDs to be opened in the default mail app.