|
***************************
For the record this is a cross-post.
I dont want to get anyone mad it's
just that i really need help with this
Original Post[^]
***************************
Hey All,
I am experiencing a strange issue, i have built and tested my RegEx in Expresso but when I call it from my code (C#) I am not getting any matches. If i step through and grab the values from the variables and put those in Expresso it works ....
RegEx:
<br />
Lead\sID\sNumber:\s*(?<LeadNumber>[^\r\n]*)(?:\r\n)+<br />
Prospect\sName:.*(?:\r\n)+<br />
Prospect\sContact:.*(?:\r\n)+<br />
Prospect\sPhone:.*(?:\r\n)+<br />
Marketing\sCampaign:.*(?:\r\n)+<br />
Prospect\sInformation:\s*(?:\r\n)+<br />
===============\s(?:\r\n)+<br />
(?<Company>[^\r\n]*)(?:\r\n)+<br />
(?<Address1>[^,]*),\s(?<Address2>[^\r\n]*)(?:\r\n)+<br />
(?<City>[^,]*),\s(?<State>[^\r\n]*)(?:\r\n)+<br />
(?<Country>[^,]*),\s(?<Zip>[^\r\n]*)(?:\r\n)+<br />
Contact\sName:\s*(?<FirstName>[^\s]*)\s(?<LastName>[^\r\n]*)(?:\r\n)+<br />
Contact\sPhone:\s*(?<Phone>[^\r\n]*)(?:\r\n)+<br />
C#:
<br />
MatchCollection myMatches = Regex.Matches([Text], [RegEx], RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace | RegexOptions.CultureInvariant);<br />
[Text] = the body of an email
[RegEx] = the above pattern
Any input or ideas would be greatly appreciated.
|
|
|
|
|
Hi,
I would debug such beast using "binary search", i.e. throw away half of the search specification, and keep doing that until something matches. Then you know the problem is in the part you last removed.
OTOH I would never come up with such a complex Regex pattern in the first place. It is just unreadable. And what happens if someone somewhere decides to add/delete a space, a new line, whatever to the e-mail format?
IMO you need several smaller operations to extract the fields individually, your code looks like a maintenance nightmare to me.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hello Luc,
Normally i would agree with you 200%, however this is a subcontract project which is going to be used by other developers. They wanted me to allow for configuration of the email parsing by having a setting which contains the RegEx to use.
You can find the solution to my problem here[^], i didn't want to keep cross posting.
Thanks again for your input.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
That's interesting. Thanks.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Is it possible (and how) to make an user control with a panel and make it a container (so that I can drop other controls on it at design time?
Or if it is simpler
If i place a button on the usercontrol - what do i need to do so i can click it at design time?
What is the point in reading a book about the future when it is allready the past.
|
|
|
|
|
Yes it is possible. A thread here[^] has the same thing as you need.
modified on Wednesday, July 15, 2009 12:38 AM
|
|
|
|
|
Hi Feudalac,
In addition to the thread that d@nish just referred you to, Henry Minute was inspired by that thread to publish an article here on CP exactly addressing this problem.
Designing Nested Controls[^]
I participated in that thread, and also illustrated one way to do this for one single usercontrol containing one container object, and you could, in theory, combine any number of these one-container-per-usercontrol objects at design time, but Henry's solution went far beyond mine in terms of practicality : his solution will let you do the same with multiple containers on one usercontrol.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Thanks all!
What is the point in reading a book about the future when it is allready the past.
|
|
|
|
|
Hello all,
My crystal report contain hyperlinks to the Event Video file (i.e..avi files).
Its format is somewhat like -
"EventVideos/EventVideo_" + {DataTable1.EventId} + ".avi"
As I create hyperlink at design time, it remains active for all the events. But the case is that my all events do not have Event Video associated with it. So, such events also have hyperlink for event video which is not expected.
To avoid this, I have to delete or disable the hyperlink for such events.
My question is - Is it possible to delete or disable the hyperlink at runtime in Crystal Report? If yes, can you please explain me how?
It will be great help. I will appreciate it.
Thanks in advance.
|
|
|
|
|
hello there,
i have been stucked with a problem in vs2008(vb.net)
I have two table one Employee and EmployeeDetail in MSSql server 2005
Employee
EmployeeID int autoincrement PK
Employeename varchar(50) not null
Employeedetail
EmployeeID int FK
EmployeeVisaNumber varchar NotNull
EmployeeAddr1 varchar(50) null
I created a datasource EmployeedataSource with add new datasource wizard
with this two tables
I then Drag this datasource to my form
First i changed the Employeedetail node in the employeenode to details view from datagrid view
and drag it into the form and then changed the view of the employee node to details and drag it again to the form
and when i run
only the master fields are getting updated to the database
or either the detail fields
I have to display the master and details in tabbed control
master in one tab
detail in another tab
and i need all functionalities(add,save,delete,update,navigation)
thanks,
suraj
|
|
|
|
|
In the DataSources Window, if you expand your Employee node you will see an EmployeeDetails node right at the bottom. It is this EmployeeDetails node that you should be using.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for your reply
But i did exactly as u told
Then also the same problem exists
|
|
|
|
|
Try working through this tutorial[^] as a new solution, so that you can get a better understanding of the process, then come back to your project and try again.
Please come back with more questions if you still have problems after doing that.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm not sure I'm in the right group for this but I'm trying to develop a program or better yet get one that's a blackjack game simulator that over million hands etc and give me the wins or losses statistics of my systems over time. It's easy to get a blackjack simulator but not one that over million hands etc and give me the wins or losses statistics of my systems over time.
Thanks in advanced for any suggestions.
|
|
|
|
|
I bid €127,895.99
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I can beat that.....€127,895.00.
To think, he expected someone to give him it for free!
|
|
|
|
|
Too bad. I need the exact amount for a new Porsche.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Microsoft has launched Front Runner [^] for Windows 7 and Windows Server 2008 R2 for software companies. The program offers tech and marketing resources to software companies who want to move to the next generation of Windows. The program is free (and once you qualify pays to help you market your Windows 7 or Windows Server 2008 R2 application).
Front Runner helps you learn how to make your app compatible, and gives you what you need to make that happen.
Once your app is compatible, you’ll get a range of marketing benefits to help you get the message out to your customers, including:
- The Front Runner stamp to use on all of your communications
- Customizable marketing and PR campaigns
- Listing in Microsoft directories that are viewed by millions of people
To learn more, see ISVs Get Ready for Windows 7, Windows Server 2008 R2 With Front Runner[^].
Front Runner [^]
|
|
|
|
|
I open a modal form to search for an order that opens another modal form to search for a customer ID to narrow the order search. When OK is clicked on the second form both modals close and return to the main form. Can someone smarter than I please point me in the right direction?
code that opens first modal
private void OpenSalesOrderSearch()
{
try
{
SOSearch soSearch = new SOSearch();
if (soSearch.ShowDialog() == DialogResult.OK)
{
MessageBox.Show("custID=" + soSearch.custID);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
code for second modal
private void CustomerSearch()
{
try
{
CustSearch custSearch = new CustSearch();
if (custSearch.ShowDialog() == DialogResult.OK)
{
custID = custSearch.custID;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
OK button code for second modal
private void btnOK_Click(object sender, EventArgs e)
{
custID = dgvCustomer.CurrentRow.Cells[0].Value.ToString();
}
|
|
|
|
|
OK I feel stupid. I had DialogResult set to cancel for the button that opened the second modal.
My first post after lurking for a few years and I make a fool of myself.
|
|
|
|
|
ProSlacker wrote: My first post after lurking for a few years and I make a fool of myself
Hi ProSlacker,
May I slightly disagree with you, and suggest you've demonstrated you are a virtuous person who is self-confident enough to publicly correct the kind of mistake anyone can make with a sense of humor in a pro-social way ?
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Hi all
I was wondering if anybody else has experienced this problem. Because it is #$^^)@& me off and I am minutes away from never using the IDE again. lol.
When I am placing controls around on a form at design time, then I save it. Exit Visual Studio, and reopen that same project, Why does visual studio stuff up the positioning of all of the controls? I mean, it never used to happen, and now it happens all the time. I have to keep on re-positioning everything all over again.
Thanks,
jase.
|
|
|
|
|
That's often a sign of a read-only file (I've had that myself).
If you're using integrated source control, it's possible that it doesn't realise you need to check out the file when you make changes in the designer.
If you're not using any kind of source control, then maybe the file has somehow become read-only by some other means.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Please Help!
I need to create a designed html form which will be placed on my laptop offline.
I would like customers to be able to come into the office and register their details using this form and all the data would be sent to an excel document. Is there any way of doing this without having to use a server. I tried to send the form to email option but it only opens up my email when I do this which I do not want.
Any help would be great.
|
|
|
|
|
I'm looking for a simple control (like a Text Box or Rich Text Box) to display formatted HTML in.
What I am creating is an email viewer for our server. Administration needs to be able to select a message from the list and its contents should go to the control.
The closest thing I can find (in Visual Studio 2005) is the WebBrowser control - but I don't want to give the browser a file to display. I simply want a way to show HTML formatted text (tables, unordered lists, hyperlinks, etc.).
Has anyone done something like this? What could I look into as far as research goes?
|
|
|
|