Category "regex"

Strict regex in Pandas replace

I need to write a strict regular expression to replace certain values in my pandas dataframe. This is an issue that was raised after solving the question that I

Regex to match words with hyphens and/or apostrophes

I was looking for a regex to match words with hyphens and/or apostrophes. So far, I have: (\w+([-'])(\w+)?[']?(\w+)) and that works most of the time, though

Make certain characters of a word from string bold

I need to highlight a certain characters from a string, I tried str_replace and preg_replace. But these work only if full word is entered, $text = str_replace(

Click an exact match text in Cypress

In Cypress, .contains command yields all matching elements, so for clicking in a dropdown item with a text on it, .contains works fine. But I'm facing the probl

javascript validate SSID and WPA/WPA2

I am trying to get 2 functions to validate an SSID and WPA2 passcode. function isValidSSID(ssid) { return (regex) } and function isValidWPA(passcode)

Reading accounting information with regex

Context In my daily job I lost a lot of time putting values in excel from a balance sheet manually, so I start learning how to code in python to speed up my wor

How to screen double quotes in Google Docs re2 expressions?

I'm trying to screen double quotes in regular expression on Google Sheets and there's no luck. A1 cell text = some "name" My formula =REGEXEXTRACT(A1;"\"(.*)\"

jQuery Validate money field, accept spaces?

I have a custom validator for money fields, it accepts values like 12,00$ 122.04$ 12123123 Now, I want to make it accept theese values: 1 200$ 1 200,22$ So ac

Insert colon separator into timings ( i.e convert 1230a to 12:30a and 1430 to 14:30 )

I have a requirement in my project whereby we have some input boxes and we are supposed to enter timings. Timings can be entered in any format i.e 12:30a or 12

Regular expression to replace inner credit card numbers with X's?

Is it possible to use regex to replace all characters in a card number with an X, except for the left-outer 4-digits and right-outer 4-digits, when the card num

Regular expression pipe confusion

How come this code returns true? string to match: ab pattern: /^a|b$/ but when I put parentheses like this: pattern: /^(a|b)$/ it will then return false.

Regular Expression to Match the Whole line

I'm new to scripting and have been reading about how to use regular expressions. I want to fetch the complete line matching a pattern. My output is: 64 bytes fr

What's a regex that matches all numbers except 1, 2 and 25?

There's an input of strings that are composed of only digits, i.e., integer numbers. How can I write a regular expression that will accept all the numbers excep

Regex matching plus or minus

Could someone please look at the following function and explain the regex for me as I don't understand it and I don't like using something I don't understand as

Wildcard matching in Java

I'm writing a simple debugging program that takes as input simple strings that can contain stars to indicate a wildcard match-any *.wav // matches <anythin

Remove parentheses and text within from strings in R

In R, I have a list of companies such as: companies <- data.frame(Name=c("Company A Inc (COMPA)","Company B (BEELINE)", "Company C Inc. (Coco)", "Company

Does mongo regex query have character limit, if the regex search string is more than that limit it throws error

I am seeing mongo regex query not returning result when the regex searched string is very big, instead its throwing error. I have a scenario where I append lot

extract all URLs in a free text block using RegEx [duplicate]

I'm attempting to detect all URLs listed in a free text block. I'm using the .nets Regex.Matches call.. with the following regex: (http|https)

How to implement a regex for password validation in Swift?

I want to implement a regex validaton for passwords in Swift? I have tried the following regex, but not successful ([(0-9)(A-Z)(!@#$%ˆ&*+-=<>)]+

Regex match whole string

I have the following pattern: [ \n\t]*([a-zA-Z][a-zA-Z0-9_]*)[ \n\t]+((char)[ \n\t]*\[[ \n\t]*([0-9]+)[ \t\n]*\]|(char)|(int)|(double)|(bool)|(blob)[ \n\t]*\[