|
-
Nov 26th, 2013, 05:17 AM
#1
Re: Extract word between "
 Originally Posted by Radjesh Klauke
Heya Paul. How have you been. Been a while.
Thanks for the example. Unfortunately I can't seem to get the "words" in RichTextbox2. (Now I think of it... perhaps it would be even better when reading it into a stream. (import them directly from the html-file))
Can you explain this part of the code?
Code:
Dim words() As String = rx.Matches(RichTextBox1.Text).Cast(Of Match).Select(Function(m) m.Groups(1).Value).ToArray
Stop
Thanks in advance.
Obviously words() as an array of strings. The line is a lambda expression. rx.matches is a matchcollection of regular expressions. We need to implicit cast each item in the matchcollection and select it. The regex expression (.+?) Using the ungreedy quantifier +? matches as little as possible. The expression matches different groups. If you changed 1 to 0 the group captured would not be what you wanted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|