Category "regex"

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]*\[

Regular expression to allow trailing and leading spaces

I now validate email addresses like so: [-+.'\w]+@[-.\w]+\.[-.\w]+ Which means that if users accidentally have a trailing or leading space in that address (

RegExp \A \z doesnt work, but thats what Rails 4 requires

I recently switched to Rails 4 and the security requirements no longer seem to allow the use of regular expressions in the style of /^..$/. The error states th

Match list of words without the list of chars around

I have this regex (?:$|^| )(one|common|word|or|another)(?:$|^| ) which matches fine unless the two words are next to each other. One one's more word'word commo

Regular Expression to matching against multiple ranges of different lengths

I need to validate if the value a user enters is one of the following: a 7 digit number ranging from 7000000 - 7999999 a 9 digit number ranging from 777000000

Regular expression for sequential numbers like 12345 or 456789

I need to prevent entering 5 digit sequential numbers like 12345, 45678 etc. in a text box. I had tried with the following regular expression, but it is not wor

Password validation REGEX to disallow whitespaces

Password cannot contain white spaces must contain at least one numeric char must contain 1 capital letter and be at least 8 characters in length, max 15 this is

JS regexp: exec(): "merge" different groups to the same result

A simplified example: Using this regular expression /^(?:(a)(b)|(c)(d))$/.exec(value); results in an array of 5 elements if matching, either ["ab", "a", "b"

How to convert string with emoji, convert emoji to string like this url with regex

How to convert string with emoji ❤️😬, convert emoji to string like this question url %EF%B8%8F with regex? function emojitourl(str) { r

I want to remove double quotes from a String

I want to remove the "" around a String. e.g. if the String is: "I am here" then I want to output only I am here.

Javascript: find all occurrences of word in text document

I'm trying to write a Javascript function to find indices of all occurrences of a word in a text document. Currently this is what I have-- //function that find

Extract house numbers from address string

I am importing user data from a foreign database on demand. While i keep house numbers separate from the street names, the other database does not. I use preg

How to extract duration of experience from resume using Python

I have written logic to extract dates of experiences from the resume. I have extracted experiences that have this format : 01/2017 - 04/2022 01/07/2017 - 31/07/

C++ - Split string by regex

I want to split std::string by regex. I have found some solutions on Stackoverflow, but most of them are splitting string by single space or using external lib

Why is my error message disappearing with two of the same RegularExpressionValidators in one page?

I have in a page 2 textboxes with the exact same RegularExpressionValidator. First case The page is loaded. I enter in Hour1 : 88:88 and Hour2 : 77:77. The seco

To check if a string is alphanumeric in javascript

I want to check if a string is STRICTLY ALPHANUMERIC in javascript. i have tried this: var Exp = /^[0-9a-z]+$/; if(!pwd.match(Exp)) alert("ERROR") But the pr

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