471,337 Members | 1,308 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Can't find the good search pattern using Regex

Hi,
I have to use Regex in order to parse Visual Basic 6 *.frm files.
I need to get all controls. I have managed to get "normal" controls without problem, but I have some problem with controls nested in themselves.

Example:

Begin VB.Menu M1
Caption = M1"
Begin VB.Menu M1-1
Caption = "M1-1"
Begin VB.Menu M1-1-1
Caption = "M1-1-1"
End
Begin VB.Menu M1-1-2
Caption = "M1-1-2"
End
End
End

Using this regex : "( *)Begin ([\w|\W]+?) ([\w|\W]+?) ?\r\n[\s|\w|\W]+\1End ?\r\n"

Capture :
Begin VB.Menu M1
Caption = M1"
Begin VB.Menu M1-1
Caption = "M1-1"
Begin VB.Menu M1-1-1
Caption = "M1-1-1"
End

I can only capture to the first "End" statement.

Can somebody help me ?

Thanks in advance
Jul 21 '05 #1
0 949

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Henrik | last post: by
4 posts views Thread by Joe | last post: by
3 posts views Thread by js | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.