Visual Studio Regex '?'

MSVS: where is the regex ?

I have code that I am trying to match with a regular expression in MSVS 2008, but I cannot find a regular expression for it. Take the classic example:

colou?r

... which is a regular expression that matches coloror colour. This does not match either MSVS. Referring to the help file, I can not find ?.

This will not be a big problem - it can be emulated with alternation:

colo(u|)r

However, I get “Grouped expression missing”). "... what is it ... no. Strangely enough, MSVS has these alternative groups (I'm not quite sure why ...) with curly braces:

colo{u|}r

" ".... . , ?? , /, (color|colour). , , .


, ...

, , . :

^[A-Z]+\t[0-9]+\t[^\t]+

^[A-Z]+\t[0-9]+\t[^\t]+\t[^\t]+

, , . ( , .)

- :

BZD 084 Belize dollar
CAD 124 Canadian dollar
CDF 976 Franc Congolais
CHE 947 WIR euro    (complementary currency)
CHF 756 Swiss franc
CHW 948 WIR franc   (complementary currency)
CLF 990 Unidad de Fomento   (funds code)

( , , WIR euro ( ), .)

, ,

^[A-Z]+\t[0-9]+\t[^\t]+

^[A-Z]+\t[0-9]+\t[^\t]+\t[^\t]+

.. ... ^ [A-Z] +\ [0-9] +\ ([^\] + | [^\] +\ [^\] +) ... - .

+5
5

Jeff Atwood . , Visual Studio , , ?. {colour|color}.

+4

, , "()" . :

colo(u|())r

,

^[A-Z]+\t[0-9]+\t{[^\t]+(\t+[^\t]+|())}

, '$'.

+1

Visual Studio find ?. . MSDN. , ,

0

:

colo(u)|()r

for your real example, this will correspond to each line:

^[A-Z]+:b[0-9]+:b[^\t]+(\t[^\t]+)|()
0
source

Have you tried with the longest common path on the right?

For example, for color and color, this would be:

colo(ur|r)

and for your 2 regular expressions it will be:

^[A-Z]+\t[0-9]+\t{[^\t]+|[^\t]+\t[^\t]+}
0
source

All Articles