Search Results

Search found 2 results on 1 pages for 'perello'.

Page 1/1 | 1 

  • Rub, regex, sentences

    - by Perello
    I'm currently building a code generator, which aim to generate boiler plate for me once i wrote the templates and/or translations, whatever the language i have to work with, and it has an educationnal part :p. So i have a problem with a regex in ruby. The regex aim to select whatever is between {{{ and }}}, so i can generae functions according to my needs. My regex is currently : /\{\{\{(([a-zA-Z]|\s)+)\}\}\}/m My test data set {{{Demande aaa}}} = {{{tagadatsouintsouin tutu}}} The results are : [["Demande aaa", "a"], ["tagadatsouintsouin tutu", "u"]] So the regex pick each time the last character twice. But, that's not exactly what i want, my need is more about this : /\{\{\{((\w|\W)+)\}\}\}/m But this as a flaw too, the results : [["Demande aaa}}} = {{{tagadatsouintsouin tutu", "u"]] Whereas, i wish to get [["Demande aaa"],["tagadatsouintsouin tutu"]] Any ideas to correct theses regex ? I could use 2 sets of delimiters, but it won't learn me anything.

    Read the article

  • Research and replace Word Rtf

    - by Perello
    I'm working on an application which has a workflow for postal mails. These postal mails are generated according to my application business rules. Models are in html or Rtf and it works perfectly as long the user do not create the rtf with word. This is not within the specs, but my hierarchy would welcome a Word compatibility if it don't involve too much work, and it would please and ease the life of our customer. The Rtf models have tags which are replaced by application values. In most RTF, tags are not splitted, so the search and replace works perfectly. I wish to be handle word with few modifications. Example data : [[FooBuzz]] in most rtf it's not splited. In word 2003 : {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid5517131 [[}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2708730 FooBuzz}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid5517131 ]]} And their word (word 2007) splitted also Foo{garbage inside} Buzz. So i wish to be able to handle common RTF perfectly, and detect tags even if they are splitted. I have 2 constraints. First no regression, second it has to stay simple. Performance is not an issue here. I'm using symfony 1.4. The actual relevant research code part : $regExpression = '/\[\[([^\[\]]*)\]\]/'; preg_match_all($regExpression, $sTemplate, $outKeys);

    Read the article

1