Click here to Skip to main content
15,892,298 members

Comments by LGSon2 (Top 4 by date)

LGSon2 29-Nov-13 0:17am View    
Thanks
LGSon2 27-Nov-13 15:55pm View    
I have considered to write a parser though regex looked like a quicker solution. Maybe a combo where regex finds the placeholder and the parser do the property list. Then it will be easy to deal with both quotaion marks and nested placeholders. A concern is of course performance, whether regex or parser is faster.
LGSon2 27-Nov-13 14:09pm View    
I am very well aware of its complexity .. and I will try to explain:
- In a text I have placeholders which will be replaced with values upon display of that very same text.
- A place holder has 3 parts, an open tag, a property list and a closing tag.
- The open tag starts with "@[" and ends with "[" and contains a dot delimited text.
- The property list is in the form av a comma separated list with qouted values.
- The close tag ends with "]]".
So far this was quite easy to fix with regex, but when a property list items can have placeholders and contain single double qoutes, it became more difficult.
The regex must overcome these issues by both knowing when reached the end of each outer placeholder as well as take care of single qoutes. About quotes, I prefer if they don't have to be escaped as they can be dynamically added with some difficulties to take control of.
LGSon2 4-Nov-13 3:06am View    
Thanks for the link to expresso