Get Groups From Words
I'm struggling to write a reg-ex that can do the following:
Label1.Caption := Edit1.Text;
Must return 2x results e.g.:
Label1.Caption
Edit1.Text
So its everything where its a word (Like "La开发者_开发百科bel1"), a dot (.) and a given set of words like "Caption", "Text" etc.
([\w.]+)\s*:=\s*([\w.]+)
This regex is more flexible than what you specified. Something like __hello...6 := oops
will also pass. If you need the restrict to the Identifier.Identifier format,
([A-Za-z_]\w*\.[A-Za-z_]\w*)\s*:=\s*([A-Za-z_]\w*\.[A-Za-z_]\w*)
精彩评论