Category "regex"

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

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