how to represent "anything" using regular expression in VB.net?

tommy_cs

Member
Joined
Jun 7, 2006
Messages
18
Programming Experience
3-5
How should I write a regular expression if I want to get a paragraph start from ABC, follow by anything includes newline, space, tab, any characters and end with DEF?

I try to do it as follow but it match nothing.

System.Text.RegularExpressions.Regex.Match(input, "ABC[\s\w\d]*DEF").Groups(0).ToString:confused:


thanks a lot.
 
Oh, and to answer the original question:

"How to represent anything?"

That would be .* in greedy mode (swallows the entire input, then spits back one at a time, looking for a match)

Or .*? in pessimistic mode (nibbles forward one at a time, looking for a match)

Occasionally .*+ in possessive mode (swallows entire input and doesnt spit back) though its usefulness is limited
 
Oh, and to answer the original question:

"How to represent anything?"

That would be .* in greedy mode (swallows the entire input, then spits back one at a time, looking for a match)

Or .*? in pessimistic mode (nibbles forward one at a time, looking for a match)

Occasionally .*+ in possessive mode (swallows entire input and doesnt spit back) though its usefulness is limited


ic..learnt a lot:)
 
Back
Top