Click here to Skip to main content
15,887,083 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionRegular expression not matching as expected Pin
tgrt14-Jun-07 4:19
tgrt14-Jun-07 4:19 
AnswerRe: Regular expression not matching as expected Pin
PIEBALDconsult14-Jun-07 16:59
mvePIEBALDconsult14-Jun-07 16:59 
GeneralRe: Regular expression not matching as expected Pin
tgrt15-Jun-07 3:40
tgrt15-Jun-07 3:40 
GeneralRe: Regular expression not matching as expected Pin
PIEBALDconsult15-Jun-07 13:49
mvePIEBALDconsult15-Jun-07 13:49 
GeneralRe: Regular expression not matching as expected Pin
tgrt15-Jun-07 16:48
tgrt15-Jun-07 16:48 
GeneralRe: Regular expression not matching as expected Pin
PIEBALDconsult15-Jun-07 19:07
mvePIEBALDconsult15-Jun-07 19:07 
GeneralRe: Regular expression not matching as expected Pin
tgrt16-Jun-07 4:16
tgrt16-Jun-07 4:16 
GeneralRe: Regular expression not matching as expected [modified] Pin
PIEBALDconsult16-Jun-07 5:43
mvePIEBALDconsult16-Jun-07 5:43 
Huh, alright, now I'm stumped. But I'll try this out myself and maybe learn something.
Fortunately, this latest post also came into my email so I have a no-smiley version of the line to use.


-- modified at 11:52 Saturday 16th June, 2007

Hmmm, I get:

System.Text.RegularExpressions.RegexParser(ScanGroupOpen)parsing "\A\d{2}[\s\t]+(?.[^\t]*)[\s\t]+(?:.[^,]*,[\s\t])*(?:.[^;]*;)[\s\t](?\d*)[;][\s\t]+{DONE}\z" - Unrecognized grouping construct.


-- modified at 12:17 Saturday 16th June, 2007

I added names for the capturing groups (I assume you specified names but used angle-brackets, try apostrophes)

@"\A\d{2}[\s\t]+(?'ErrorMessage'.[^\t]*)[\s\t]+(?:.[^,]*,[\s\t])*(?:.[^;]*;)[\s\t](?'Number'\d*)[;][\s\t]+{DONE}\z"

But it doesn't match... yet.


-- modified at 12:35 Saturday 16th June, 2007

OK, it matches, and misbehaves as described.


-- modified at 12:51 Saturday 16th June, 2007

The missing text is going to the second non-capturing group (I made it capture just to see).

It appears the first group isn't being greedy enough.


-- modified at 13:02 Saturday 16th June, 2007

This
@"\A\d\d\t(?'ErrorMessage'[^\t]*)\t;\s*(?'Number'\d*);\s*{DONE}\z"
works on the sample provided.


-- modified at 13:16 Saturday 16th June, 2007

First, I'll say that \s includes \t, so [\s\t] can be simplified to \s

Other than that, I changed this V from a + to a * and it seems to work
@"\A\d{2}\s+(?'ErrorMessage'.[^\t]*)\s*(?:.[^,]*,\s)*(?:.[^;]*;)\s(?'Number'\d*);\s+{DONE}\z"
I would also remove these ^ ^ ^


GeneralRe: Regular expression not matching as expected [modified] Pin
PIEBALDconsult16-Jun-07 7:47
mvePIEBALDconsult16-Jun-07 7:47 
GeneralRe: Regular expression not matching as expected Pin
tgrt16-Jun-07 13:20
tgrt16-Jun-07 13:20 
GeneralRe: Regular expression not matching as expected Pin
PIEBALDconsult16-Jun-07 17:20
mvePIEBALDconsult16-Jun-07 17:20 
GeneralRe: Regular expression not matching as expected Pin
tgrt17-Jun-07 5:05
tgrt17-Jun-07 5:05 
GeneralRe: Regular expression not matching as expected Pin
PIEBALDconsult17-Jun-07 7:08
mvePIEBALDconsult17-Jun-07 7:08 
GeneralRe: Regular expression not matching as expected Pin
tgrt24-Aug-07 11:17
tgrt24-Aug-07 11:17 
GeneralRe: Regular expression not matching as expected Pin
PIEBALDconsult24-Aug-07 13:52
mvePIEBALDconsult24-Aug-07 13:52 
QuestionAsynchronous Web service call? Pin
Nithin Krishna14-Jun-07 1:46
Nithin Krishna14-Jun-07 1:46 
AnswerRe: Asynchronous Web service call? Pin
Manas Bhardwaj14-Jun-07 10:18
professionalManas Bhardwaj14-Jun-07 10:18 
GeneralRe: Asynchronous Web service call? Pin
Colin Angus Mackay14-Jun-07 11:43
Colin Angus Mackay14-Jun-07 11:43 
Questioni cant setup visual studio..?strange problem.. Pin
Mir_As14-Jun-07 0:45
Mir_As14-Jun-07 0:45 
AnswerRe: i cant setup visual studio..?strange problem.. Pin
Vasudevan Deepak Kumar15-Jun-07 2:56
Vasudevan Deepak Kumar15-Jun-07 2:56 
QuestionHow can i solve this? Pin
$uresh $hanmugam12-Jun-07 23:59
$uresh $hanmugam12-Jun-07 23:59 
AnswerRe: How can i solve this? Pin
Fatbuddha 113-Jun-07 2:27
Fatbuddha 113-Jun-07 2:27 
AnswerRe: How can i solve this? Pin
Dave Kreskowiak13-Jun-07 3:56
mveDave Kreskowiak13-Jun-07 3:56 
AnswerRe: How can i solve this? Pin
Christian Graus14-Jun-07 11:21
protectorChristian Graus14-Jun-07 11:21 
QuestionDoes .Net have anything like COM standalone server? Pin
Shao Voon Wong12-Jun-07 20:47
mvaShao Voon Wong12-Jun-07 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.