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,6 8,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+("(?<ControlText>.*?)",\s*)?(?<Id entifier>\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 1 1624
On Dec 13, 9:20 am, pepethecow <pepethe...@gmail.comwrote:
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,6 8,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+("(?<ControlText>.*?)",\s*)?(?<Id entifier>\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... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike |
last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or
comments on how to make this work I would be grateful! I have been working
on this for the past 4 days and nothing I do...
|
by: Johnny |
last post by:
I need to determine whether a text box contains a value that does not convert
to a decimal. If the value does not convert to a decimal, I want to throw a
MessageBox to have the user correct the...
|
by: Martin Andert |
last post by:
Hello,
i want to parse some html with regex and have the following problem:
--- html to parse start ---
some text <span class="x">
some text with linebreaks
and tabs and <b>tags <i>in...
|
by: ilPostino |
last post by:
hi,
I'm trying to write my own code-dom because I don't like the ms one ;-)
I want to look for this expression, ( using someword; ) but I can only
figure out basic things like searching for...
|
by: sasifiqbal |
last post by:
Hi All,
I have following text Template that needs to be parsed using Regular
Expression
-- Test Template
This is a Test Template for <#OrderNumber/>
Sender Message is <#SENDERMESSAGE/>
|
by: Extremest |
last post by:
I have a loop that is set to run as long as the arraylist is > 0.
at the beginning of this loop I grab the first object and then
remove it. I then go into another loop that checks to see if there...
|
by: Steve |
last post by:
Hi All,
I'm having a tough time converting the following regex.compile patterns
into the new re.compile format. There is also a differences in the
regsub.sub() vs. re.sub()
Could anyone lend...
|
by: Simon Brooke |
last post by:
As various people will have noticed, I've been having a lot of trouble with
XSL lately. Brief history: I wrote myself an XML toolkit back in 2000, and
it worked well enough for me, so it's been...
|
by: =?Utf-8?B?c2JwYXJzb25z?= |
last post by:
I have a scenario where a string is sent in chunks to my app. I need to be
able to identify certain tags in this partial string as it arrives.
eg
<DALFile>xxxxxxxxx</DALFile>
I need to be able...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |