I'm having some trouble matching what I want to. I need to match:
data [--name--]data[-!name-!]
where the end "name data name" sequence can occure zero or one times as well as the begining data. This seem like it could be done as follows:
(.*?)(\[--(.+?)--\](.+?)\[-!\\3!-\])?
This doesn't work because since the first (.*?) will just stop after one letter since it doesn't need to be followed by anything. Does anyone know what I'm talking about? I don't know if I'm expressing it right. Anyone have any ideas on what I could do? Thanks.
data [--name--]data[-!name-!]
where the end "name data name" sequence can occure zero or one times as well as the begining data. This seem like it could be done as follows:
(.*?)(\[--(.+?)--\](.+?)\[-!\\3!-\])?
This doesn't work because since the first (.*?) will just stop after one letter since it doesn't need to be followed by anything. Does anyone know what I'm talking about? I don't know if I'm expressing it right. Anyone have any ideas on what I could do? Thanks.