Hi,

“How to know if a regex is partially matches a part of the text ?

      -> with the regex java library it seems not possible (as far as I know, 
but I may be wrong)”

I don’t think it’s possible too.



Concerning your problem I was thinking you would make this kind of algorithm:

if (isIdent() /* asking regular expression or style*/)

{

      // flag and buffers are attributes of the class

      flag = true

      buffer = new StringBuffer();

}

if (flag)

{

      If (isNotEndText())

      {

            Buffer.append(getText());

      }

      else

      {

            Flag = false;

      }

}



For some users we made this algorithm and it was working



Regards

Tristan FAURE



-----Message d'origine-----
De : [email protected] 
[mailto:[email protected]] De la part de Topcased user 
list where issues are discussed
Envoyé : vendredi 11 mars 2011 09:57
À : [email protected]
Objet : Re: [Topcased-users] [requirement] support for import



Hi Tristan



Thank you for your answer. As I'm not expert in eclipse architecture, I would 
like to get sure I've well understood how to customize doc2model :



You suggest me to add an extension that will in some way, understand a 
multiline regex (or at least my particular multiline regex)...

The checker class would be called at each new paragraph, and the checker shall 
remember, by any means the previous lines checked given the following 
pseudocode :



let rx = my multiline regex expression

let nl = the newline extracted from the doc

let bf = a buffer for storing previous lines



if (buffer is empty) then

  switch

      case nl or part of nl match the entire rx

            -> we store the matched string to output



      case nl or part of nl match the beginning of rx

            -> we store the matched string to bf



      else

            -> we drop the string

else //buffer not empty

  switch

      case (bf + nl) or (bf + first part of nl) match the entire rx

            -> we store the matched string to the output



      case (bf + nl) match the beginning of rx

            -> we store the matched string to bf



      else we drop the string





If that first pseudocode is clear for you, I might continue with the second 
question :

How to know if a regex is partially matches a part of the text ?

      -> with the regex java library it seems not possible (as far as I know, 
but I may be wrong)

      -> creating a checker specially for one particular regex, having it 
cutted according to the different cases (one if buffer is empty, and one if 
buffer is not empty)





Regards



Cédric Gava

_______________________________________________

Topcased-users mailing list

[email protected]

http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

________________________________

Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra 
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Origin group liability cannot be triggered 
for the message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to