MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Regex to parse dlg template controls

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp
Author Message
pepethecow



Joined: 13 Dec 2007
Posts: 2

PostPosted: Thu Dec 13, 2007 11:20 am    Post subject: Help with Regex to parse dlg template controls Reply with quote

I hope this is the appropriate group for this question--the regex
group didn't look too appealing.

I am trying to build a regex to parse out dialog controls from C++ RC
files. Suppose the input text is:

IDD_ADDPRINTDLG DIALOGEX 0, 0, 284, 87
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
CONTROL "Color",IDC_COLOR,"Button",BS_AUTORADIOBUTTON,
11,68,33,14
CONTROL "Grayscale ""Quoted Text
""",IDC_GRAYSCALE,"Button",BS_AUTORADIOBUTTON,50,68,47,14
CONTROL "Faxable
Image",IDC_FAX,"Button",BS_AUTORADIOBUTTON,103,68,59,14
GROUPBOX "Printing Options",IDC_PDOPTIONS,8,59,271,26
GROUPBOX "Footer Text",IDC_FOOTERBOX,8,4,272,51
EDITTEXT IDC_FOOTER,13,13,262,40,ES_MULTILINE |
ES_WANTRETURN
END

If I use the regex (EDITTEXT|CONTROL|GROUPBOX|LTEXT|PUSHBUTTON|
DEFPUSHBUTTON)\s+("(?.*?)",\s*)?(?\w+),[\v\f
\S]+\n

it finds everything except the EDITTEXT line, which doesn't have the
optional ControlText field. I've stared at this for a few hours now
trying to figure why it can't find it. Any ideas?

Thank you.

-Ben

Archived from group: microsoft>public>dotnet>languages>csharp
Back to top
View user's profile Send private message
pepethecow



Joined: 13 Dec 2007
Posts: 2

PostPosted: Thu Dec 13, 2007 11:35 am    Post subject: Re: Help with Regex to parse dlg template controls Reply with quote

On Dec 13, 9:20 am, pepethecow wrote:
> I hope this is the appropriate group for this question--the regex
> group didn't look too appealing.
>
> I am trying to build a regex to parse out dialog controls from C++ RC
> files. Suppose the input text is:
>
> IDD_ADDPRINTDLG DIALOGEX 0, 0, 284, 87
> STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP
> FONT 8, "MS Sans Serif", 0, 0, 0x0
> BEGIN
> CONTROL "Color",IDC_COLOR,"Button",BS_AUTORADIOBUTTON,
> 11,68,33,14
> CONTROL "Grayscale ""Quoted Text
> """,IDC_GRAYSCALE,"Button",BS_AUTORADIOBUTTON,50,68,47,14
> CONTROL "Faxable
> Image",IDC_FAX,"Button",BS_AUTORADIOBUTTON,103,68,59,14
> GROUPBOX "Printing Options",IDC_PDOPTIONS,8,59,271,26
> GROUPBOX "Footer Text",IDC_FOOTERBOX,8,4,272,51
> EDITTEXT IDC_FOOTER,13,13,262,40,ES_MULTILINE |
> ES_WANTRETURN
> END
>
> If I use the regex (EDITTEXT|CONTROL|GROUPBOX|LTEXT|PUSHBUTTON|
> DEFPUSHBUTTON)\s+("(?.*?)",\s*)?(?\w+),[\v\f
> \S]+\n
>
> it finds everything except the EDITTEXT line, which doesn't have the
> optional ControlText field. I've stared at this for a few hours now
> trying to figure why it can't find it. Any ideas?
>
> Thank you.
>
> -Ben


As usual, talking about it helped me figure it out on my own. The
problem was with the spaces around the pipe in the EDITTEXT line...

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
DateTime.Parse .. what's different in .NET 1.1 Hello In .NET 1.0, the following code worked fine public string dateFormat = zzz"; DateTime date, minDate; date = In .NET 1.1 I get an System.Format exception For Example, this gene

Header and Footer in template Hello I use header and footer in a device specific template on a paginated form with a list. I put a label control (LblPage) in the header and want to modify the text with currentpage properties. How to reference this label in the code. The LblPage is unk

CheckBox Template Column I need to highlight a datagrid row if the check box is selected for that row. I am really not clear how to reference it. TIA, Steve Wofford

Best way to get certain data from VB6 to Word template Hi All I've got to explain this one so that it makes sense. Basically I have the routine where I can link my VB app to a Word doc template file and 'paste' values from a VB array (created from an ADO/SQL query) into the places where I have created my Word

template column of datagrid I have used a template column for my datagrid. I've used a textbox control as the layout for my Item template. But I'm unable to view the data in my page after the execution. I'm new to web and web controls .Please help me Provide few good links which exp
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group