C#使用正则表达式代码查找 [英] C# Find with Regex codes

查看:91
本文介绍了C#使用正则表达式代码查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,我有两种形式,第一种形式可用richTextBox1,第二种形式可用textBox1和button1。我的问题是,一旦按下button1,我就无法使用正则表达式代码在richTextBox1中查找/搜索textBox1值。请看下面的想法并帮助我。



1.一旦发现第一次出现,它应该突出显示并能够在眨眼后搜索其他事件(不是从头开始)或者在最后一次搜索之后)它应该在眨眼之后。

Hi Friends, I have two forms, first form available richTextBox1 and second form available textBox1 and button1. My problem is, once pressed the button1, I cannot find/search textBox1 value in richTextBox1 using regular expression codes. Please see below ideas and help me.

1. Once found the first occurrence it should be highlighted and able to search other occurrence after the blink mark (not from the beginning or after the last search) It should be after the blink.

推荐答案

首先,你有一个问题,就是在另一个表单中查找信息。 />
请参阅(可能):传输信息两种形式之间,第2部分:儿童到父母 [ ^ ]但可能这样:在两种表格之间传递信息,第1部分:父母对儿童 [ ^ ]



第二件事是搜索本身。这(令人惊讶)很简单,但你不想(或者可能需要)一个正则表达式: http:/ /www.dotnetcurry.com/ShowArticle.aspx?ID=146 [ ^ ]显示了一种简单的方法,可以通过选择进行查找/查找。
First off, you have the problem of looking in one form for information in the other.
See (probably) this: Transfering information between two forms, Part 2: Child to Parent[^] But possibly this: Transfering information between two forms, Part 1: Parent to Child[^]

The second thing is the search itself. This is (surprisingly) simple, but you don''t want (or need, probably) a regex: http://www.dotnetcurry.com/ShowArticle.aspx?ID=146[^] shows a simple way to do the find/find next with selection.


这篇关于C#使用正则表达式代码查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆