C# Regex Class acts odd

Published on Tue Mar 01 2022

Based on my understanding of Regex, the string “10” matches the Regex “^([0-9]*)(\\*)$”. To validate it, I tried the regex and the text “10” on the website and it worked. But when I tried the same with C# code, it failed.Only by adding a "?", making the regex “^([0-9]*)(\\*)?$” makes the string "10" validate against the regex. I am confused why it behaves differently in the C# Regex class.

Additional matching regexes for
C# Regex Class acts odd

C# Regex Class acts odd

Based on my understanding of Regex, the string “10” matches the Regex “^([0-9]*)(\\*)$”. To validate it, I tried the regex and the text “10” on the website and it worked. But when I tried the same with C# code, it failed.Only by adding a "?", making the regex “^([0-9]*)(\\*)?$” makes the string "10" validate against the regex. I am confused why it behaves differently in the C# Regex class.

Get value from string

Used to get a value from a class e.g.: [...] class="font-12"[...] This regEx will receive "12" given the content of the class

Matching Character Class Transitions (customization of \b)

\b can be replicated as (?<=\w)(?=\W)|(?<=\W)(?=\w) Understanding how to create these class transitions can be beneficial for several reasons. In this instance, counting the results of this regex can be used to measure randomness within strings containing multiple character classes.

Website validation

Simple website validation for your casual usage

KZ phone regexp

Regexp for kz website mask "+7(999) 999-99-99"

Emoji detection for JavaScript

Emoji symbols character sets (added \s and +) based on https://github.com/franklsf95/ruby-emoji-regex

match C# class definition

match C# a class definition

RegEx to validate oAuth 2.0 redirect_uri

A simple RegEx rule which should validate redirect_uri for oAuth2

Match String ( /* 1 */)

Matches the comment string from Robo3T exports

PHP DateInterval Specification Validator

This REGEX could be used to validate a PHP DateInterval specification.