Regular Expressions 101

Community Library

Community Library Entry

1

Regular ExpressionOpen Workspace

/
^([0-9]*)(\\*)$
/

Description
Created·2014-09-04 14:26
Type·Match
Flavor·PCRE (Legacy)

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.

Submitted by Anonymous
Open Workspace