[Solved] Java: Regex: +Quantifier not working

[…] matches any character defined in the character class, so [X{9,11}\\*{2,3}] actually means, a single character which is: X, or open brace, or 9, or comma, or 1, or 1 (yes you have it duplicated), or backslash, or asterisk…. So as your string have more than character in your string to-be-matched, such pattern will not … Read more

[Solved] looking for regex for name age gender with mandatory spaces in between [closed]

First of all, let’s see what it is going to be matched by the pattern you mentioned: ===================================================================== ^[a-zA-Z]+(([\’\ \][(^10$|^[0-9]{1,2}]))+(([\’\ \][(?:m|M|f|F|)$]))*$ ===================================================================== Assert position at the beginning of the string «^» Match a single character present in the list below «[a-zA-Z]+» Between one and unlimited times, as many times as possible, giving back as needed … Read more

[Solved] Searching a String using C#

If you’re a masochist you can do this old school VB3 style: string input = @”</script><div id=’PO_1WTXxKUTU98xDU1′><!–DO NOT REMOVE-CONTENTS PLACED HERE–></div>”; string startString = “div id='”; int startIndex = input.IndexOf(startString); if (startIndex != -1) { startIndex += startString.Length; int endIndex = input.IndexOf(“‘”, startIndex); string subString = input.Substring(startIndex, endIndex – startIndex); } solved Searching a String … Read more

[Solved] username regex in rails 4 [closed]

You could use this regex: ^(\w|\.)+$ Which is the same as: ^[a-zA-Z0-9_\.]+$ Here’s preview of the regex in action on regex101.com, and here’s a breakdown of it ^ matches the beginning of the string ( just groups the characters so a modifier can be applied \w matches any character that is a-z, A-Z, 0-9, and … Read more

[Solved] How to use: Password regular expression for different validation [duplicate]

Resulting from the descussion, you need one regular expression for each check to perform. At least 8 characters: ^.{8,}$ No whitespace character: ^\S*$ Both combined: ^\S{8,}$ Explanation: ^ Start of the string $ End of the string . Any character (inclusive whitespace) \S Any characters that is not whitespace {8,} previous expression 8 or more … Read more

[Solved] Regex pattern can’t figure out

This will work ^\d{4}-\d{3,4}-[23]$ Regex Demo Regex Breakdown ^ #Start of string \d{4} #Match 4 digits – #Match – literally \d{3,4} #Match 3 or 4 digits – #Match – literally [23] #Match 2 or 3 $ #End of string 0 solved Regex pattern can’t figure out

[Solved] How to make PHP BB Codes with RegExp?

The user asked for something simple, so I gave him something simple. $input = “[link=http://www.google.com]test[/link]”; $replacement = preg_replace(‘/\[link=(.*?)\](.*?)\[\/link\]/’, ‘<a href=”https://stackoverflow.com/questions/10458103/”>$2</a>’, $input); Where /\[link=(.*?)\](.*?)\[\/link\]/ is the regex, <a href=”https://stackoverflow.com/questions/10458103/”>$2</a> is the format, $input is the input/data, and $replacement is the return. 1 solved How to make PHP BB Codes with RegExp?