The problem is the "\." - characters after the backslash are interpreted Escape Sequence, which in your case makes (luckily) no sense. Two ways to fix it: Regex theRegex = new Regex("[-+]?([0-9]*\\.)?[0-9]+ "); Regex theRegex = new Regex(@"[-+]?([0-9]*\.)?[0-9]+ ");
---------------------- ~hamster1
hamster1
Posts
-
Regex "Unrecognized Escape Seq?" -
can this be done in C# / .NET / WinForms? -
How to disable some strings in the ComboBoxSimple answer: Impossible. An owner-drawn combobox would help here, but I advise against it: It violates every UI design guideline. A better way would be to manage your content - delete invalid combobox items. ---------------------- ~hamster1
-
How can I get WM_KEYDOWN message in the CWnd-derived class?Now what - dialog of CWnd?? With dialogs you'll never get this msg since always a child wnd has the focus. Dig into PreTranslateMessage() instead. ---------------------- ~hamster1
-
variables initialization in the constructorIf you get the name from the outside, go with this:
class a( const char* a_name) { strcpy(name,a_name); // note: unsafe ;-) }
However, if you know the name at compile time already, simply hard-code it - gives more speed and security.class a { const char* get_name() const { return "blabla"; } }
---------------------- ~hamster1 -
const char* to LPCTSTR conversionHave a look at the macros like A2CT, use MSDN "String Conversion Macros". That was VC6, with VC7 their name has changed a bit (to A2CTEX or something). ---------------------- ~hamster1
-
Capturing The Build Date Into CodeIn VS.NET, open Solution Explorer, right-click on your project (.exe). Go to Properties > Common Properties > Pre-build... What you type there is basically a batch file. ---------------------- ~hamster1
-
Tricky XPath query C#Try this:
//DEPT[@CODE="DC1"]/EMP[@NAME="A"]
---------------------- ~hamster1 -
Capturing The Build Date Into CodeDon't know about automatic... I would use the PreBuild event, there you can call a simple generator which might create something like "CurrentData.cs", content would be then a simple "const string CURRENT_DATE=...". ---------------------- ~hamster1