Bonjour
Je souhaite créer un motif pour "matcher" ceci :
(MMM.M NNN.N PPP.P QQQ RR.R S.SS TT.T b7b6b5b4b3b2b1b0<cr>
MMM.M (M is an integer number ranging from 0 to 9.)
NNN.N (N is an integer number ranging from 0 to 9.)
PPP.P (P is an integer number ranging form 0 to 9.)
QQQ (QQQ is a percentage)
RR.R (R is an integer number ranging from 0 to 9.)
SS.S or S.SS (S is an integer number ranging from 0 to 9.)
TT.T (T is an integer number ranging form 0 to 9.)
b7b6b5b4b3b2b1b0. Where bn is a ASCII character ‘0’ or ‘1’.
Stop Byte : <cr>
Example:
(208.4 140.0 208.4 034 59.9 2.05 35.0 00110000<cr>
J'utilise ce lien pour m'aider à préparer ma regex. :
https://regexper.com/#R%22%28%5B%5C%...B%5Cr%5D%29%22
Ca se rapproche de ce que je souhaite retrouver mais je ne sais pas comment élaborer la partie du motif correspondant à :
SS.S or S.SS
Je ne sais pas comment faire l'un ou l'autre ?
D'autre part, j'utilise {3} pour dupliquer le motif 3 fois, mais je ne le vois reproduit que 2 fois (n-1 fois) dans la "simulation".
Partager