Category "regex"

Regex that gets the last set of numbers from a string

"abc_d1.txt" should get 0 "abc_d1_2.txt" should get 2 "abc_d1_14.txt" should get 14 "abc_d12_x2_156.txt" should get 156 This is what I've done so far, but I am

Escaping back-references in recursive search

Is it possible to back-reference the result of an outer :g command in a recursive call (or an inner :s call?) For instance, let's say I want to search for somet

Remove a pattern from a character

I have a character like this: x = "abc [File: abcbdosln}} \n abc \n" And I want to remove File: abcbdosln}} \n from x so that the result would be "abc [ abc \n"

How to capture the field values in the csv file using bufferedreader

The csv file looks like this I'm trying to get the field values like name, it is the value after $$NAME$$ (there is a space after the identifier). How do I st

str_detect removing some but not all strings with specified ending

I'd like to remove any string that ends in either of 2 characters in a pipe. In this example it's ".o" or ".t". Some of them get removed, but not all of them, a

Retrieve array of substring matched with regex in swift

Is there any way to retrieve an array of words prefixed with @ sign in a string? "@City == xyz AND @Hobby == gardening" -> ["@City","@Hobby"] I tried below

Grafana exclude values from query with wildcard

I have a grafana query that sums a number of stats, my query looks like alias(summarize(sumSeries(stats.checkout-*.*.*.*.*), '$time', 'sum', false), 'checkout')

regular expression to return the uppercase message in parenthesis, after the process id

I want the extract_pid function to return the uppercase message in parenthesis, after the process id. Following code is printing pids but not sure how to add ca

checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with at least the first character in uppercase

The contains_acronym function checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with at least the first character in

Regex - Remove special characters but retain negative numbers

I'm building a Number Stepper component in React which needs to support integers (both positive and negative) and decimal numbers. I want to only hold the numer

IP Address regex with netmasks

the format goal: require a.b.c.d/x where >> a is 1-3 digit num btw 1-223 b, c, and d are 1-3 digit num btw 0-255 and *required x is 1 or 2 digit num btw 8

REGEXEXTRACT between strings but only display numbers in Google Sheets [closed]

I have a Google Sheets formula below, which extracts the contents between a multi line string: =REGEXEXTRACT(A2, "(?ms)mystring1(.*)mystring2"

AutoHotKey Date Parsing returning today's date

I had been working on a QoL macro to convert selected text dates into a desired format. For that purpose I was trying to utilize the DateParse function that is

Regular expression to stop at first match

My regex pattern looks something like <xxxx location="file path/level1/level2" xxxx some="xxx"> I am only interested in the part in quotes assigned to

failregex misses entries

I need to hit ›page not found‹ log entries like this one: 185.220.100.252 - - [13/May/2022:10:03:58 +0200] "GET /EXPLOIT.php HTTP/1.1" 404 14780 "

In Telegraf how to include only specific values of a tag

I am using a prometheus plugin in Telegraf to get the data from promitor and push it to InfluxDB. However, as per my requirement there is one tag named as "reso

Regex catch bad octet in IP

Hi can someone explain me why last octet of the IP if 01 or 001 is not capched by this regex ? (\.?)([2-9][5-9][6-9]|[3-9][0-9][0-9]|0[0-9][0-9]?)($|\.) Debug

How to search for dialogues in quotation marks and dashes?

I would like to search for dialogues in between quotation marks and dashes, but I can't seem to code it. Regarding dialogues marked by quotation marks, I have f

Jenkins groovy regex pattern search and match in commit message not working as expected

I'm working with this pipeline where running tests from a commit message should be an option. I'm a novice in groovy and regex, but I have managed to get matche

How to convert 10 digits with this format XXX-XXX-XXXX to US formal format that looks like (XXX) XXX-XXXX using Python3 Regex sub

This is my try, it actually put the first and seconds groups of 3 digits between parenthesis while I only need to put the first group only between parenthesis