On Fri, 1 Feb 2008 10:48:41 -0800 (PST), alexvorn2
<al*******@gmail.comwrote:
>Hi!, how to get the text that is between < and if it's length is
more that 10 characters , text contains this:
<
to select this text
>>
<to select this text too>
<thisnot
>>
You asked how to do this using regular expressions. You can use the
following regex:
<(.{10,})>
This will capture the text excluding the angle brackets, in your first
two examples above. It will not match your third example.
For this to work, you must instruct the regex parser that dot may
match a newline. You do this in .NET via the RegexOptions.Singleline
enum.
One thing to consider is that newline and carriage return count as
characters. Consider the following:
<
12345678
>
This will match, because there are ten characters between the angle
brackets.