The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
The editcontrol function ''Find'' specifies an option for bUseRegex. I set it to true and set my ''str'' parameter to a regular expression, but get not results. Can I get some examples of using the Find function with regex.
ADAdministrator Syncfusion Team November 4, 2004 02:08 PM UTC
Hi Willaim
Here is a sample code snippet that you can add to any of the Essential Edit samples that ship:
private void button1_Click(object sender, System.EventArgs e)
{
Regex rg = new Regex("&\\w{1,}");
string searchstr = (rg.Match(this.editControl1.GetString(this.editControl1.CurrentLine)).Value);
if (searchstr=="")
{
MessageBox.Show("No Text matching the pattern found in Line: " + this.editControl1.CurrentLine.ToString());
}
Syncfusion.Windows.Forms.Edit.EditLocationRange range = editControl1.Find(new Syncfusion.Windows.Forms.Edit.EditLocation(this.editControl1.CurrentLineChar.L,this.editControl1.CurrentLineChar.C),searchstr,false);
this.editControl1.Select(range);
this.editControl1.Focus();
}
The thing to note is that you need pass the string that you want to find when you use the EditControl''s Find method.
In this case it locates it finds a word beginning with a & in a particular line (like say &test).
Regards
Arun