Category "regex"

Is it possible to use only lookaround to match characters that are not repeated immediately before and after?

For example, to match the first slash after the domain name in the URL. Intent: Only match '/' in '.com/...' but not any '/' in 'https://'. url = 'https://examp

Grep exclude count of occurence match between comments <!-- --> of curl body

I am very new to linux & bash script. I'm trying to read an xml file using curl command and count the number of occurrence of the word </entity> in it

Match multiline text using regular expression

I am trying to match a multi line text using java. When I use the Pattern class with the Pattern.MULTILINE modifier, I am able to match, but I am not able to do

Adaptive Card Input.Date

How to Set Todays Date as Minimum value in Input.Date Action of Adaptive Card. When a user select date ,all Backdates & Previous dates need to be blocked an

How to extract all words of a camel cased string with a regular expression?

Assume I have a string that consists of multiple words. These words aren't separated by spaces, but every word starts with a capital letter. This type of naming

Convert regexp.FindStringIndex results to character indices

The regexp.FindStringIndex(s string, n int) []int function returns byte indices of matches. In simple scenarios, these locations correspond to the "character p

Regex - Search VSCode files for one string following another (multiline) but where another string doesn't appear between them at the start of a line

In VSCode, I'm looking for all files that contain a return statement followed by the word use but that don't have const [A-Z] at the start of a line in between

grep positive/negative integer value only

I am looking to grep any positive/negative integers only and no decimals, or any other variation including a number. I have a testpart1.txt which has: This is a

Using foreach instead of map and grep in perl

my @a_columns = map { s/^"|"$|\n|\r|\n\r|"//g; $_ } split /;/, $s_act_line; above mentioned is my code. i am getting automatic warning while merging this code

Seems RegEx's 'OR' operator does not work

I have a pattern of regex that should match input that way: Work -> correct {"name": "name"} -> correct (any correct json format object) War And Piece -&g

Golang - extract links using regex

Golang - extract links using regex I need to get all links from text which are in specific domain example.de using Regex in Go Below are all possible links that

Inserting a variable string inside my regex is not working in javascript [NOT a duplicate]

Hi, I have this code: var regcat = /\b(aa1)[a-z]\d+[.][g][i][f]\b/; var testit = "aa1a2.gif"; console.log(regcat.test(testit)); it produces TRUE as expected b

Using Angular Validators to create a restriction of 6-12 characters, but NOT of length 9

I am trying to create a Angular Validator that allows me to validate a string of both letters and characters of lengths 6-12 inclusive, but not of length 9. I h

Regex to match strings not enclosed in macro

In a development context, I would like to make sure all strings in source files within certain directories are enclosed in some macro "STR_MACRO". For this I wi

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

I manage to do partially just one part, but cannot make the second part work. If a word has < 4 characters, only * should be included at the end of that wo

How to write a regex capture group which matches a character 3 or 4 times before a delimiter?

I'm trying to write a regex that splits elements out according to a delimiter. The regex also needs to ensure there are ideally 4, but at least 3 colons : in e

Regex for 16 hex char string that contains at least one letter

I want to write regex to recgonize a hex string with length of 16 bytes, for example: 1a2b3c4d1a2b3c4d The following answers is NOT correct: [0-9a-fA-F]{16} b

Regex for 16 hex char string that contains at least one letter

I want to write regex to recgonize a hex string with length of 16 bytes, for example: 1a2b3c4d1a2b3c4d The following answers is NOT correct: [0-9a-fA-F]{16} b

Remove underscore and number at the end of string

I am working with a dataset that has column with some underscores. There is a patter to it but they are different patterns, as shown below ID Col1 1029

How to validate a character set in terraform variable?

i need to validate a variable in terraform. The content of the variable should be only 0-9, a-z and A-Z. Im tried it with following code: variable "application_