使用正则表达式从rtf中选择带下划线的文本
我想选择下一段带下划线的文本。您会看到 Richtextbox 的 rtf 具有以下带下划线文本的代码:
\ul\i0 hello friend\ulnone\i
但普通文本看起来像带下划线的。我想要做的是单击按钮,rtfbox 应该选择下一条带下划线的文本。一个示例文本是:
hello [friend your] house [looks] amazing.
想象一下方括号内的单词带有下划线。当我第一次单击按钮1时,应选择“您的朋友”,下次单击时应选择“看起来”。继续前进并继续选择应用程序类型。我知道这可以使用正则表达式来完成,但无法构建逻辑。
任何帮助将不胜感激。非常感谢:D
i want to select the next piece of text which is underlined. You see the rtf of a richtextbox has following code for an underlines text :
\ul\i0 hello friend\ulnone\i
But the normal text looks like underlined. What i want to do is on a click of button the rtfbox should select the next piece of text which is underlined. An example piece of text is :
hello [friend your] house [looks] amazing.
imagine the words within square brackets are underlined. When i first click button1 "friend your" should be selected and on next click "looks" should be selected. Kind of keep moving forward and keep selecting it type of application. I know this can be done using regex but can't build a logic.
Any help will be appreciated. Thanks a lot :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正则表达式将是
解释
The regex would be
Explanation