Welcome, Guest
Username: Password:
  • Page:
  • 1

TOPIC:

Matching mechanisms * and ? inside charstrings 25 Sep 2008 10:20 #7436

  • Jes
  • Jes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Dear all,

Reading the standard we don't have clear wether "?" and "*" can be used
in charstrings as matching mechanisms without using a pattern.

There is one example in B1.4.1 where these mechanisms are used without
using pattern, and this is also understood reading 15.7.3 and table 9
in 15.7:

template Mymessage MyTemplate:=
{
field1 := complement ({4,5},{1,4,8,9}) length (1 .. 6), // any value
containing 1, 2, 3, 4,
// 5 or 6 elements is accepted provided it is not {4,5} or {1,4,8,9}
field2 := "ab*ab" length(13) // max length of the AnyElementsOrNone
string is 9 characters
}

However, there are some other places where it says that they shall only
be used with patterns, like B1.3.1.1 and B.1.3.2.1, or the grammar:

"If it is required to express the "?" wildcard in character strings
it shall be done using character patterns
(see clause B.1.5). For example: "abcdxyz", "abccxyz" "abcxxyz" etc.
will all match pattern "abc?xyz". However,
"abcxyz", "abcdefxyz", etc. will not."

What is the correct interpretation?

Thanks in advance,
--

BELEN2 Firma

Jes

Please Log in to join the conversation.

Matching mechanisms * and ? inside charstrings 25 Sep 2008 10:42 #7437

Dear Jesús,

thanks of pointing this out, of course, the example is incorrect. No interpretation is needed (I don't think that an incorrect example can override a direct specification), this is clear from the definitions of Anyelement and AnyElementOrNone in clauses B.1.3.1. and B.1.3.2:
"The matching symbol "?" (AnyElement) is used to indicate that it replaces single elements of a string (except character strings),.."
and
"The matching symbol "*" (AnyElementsOrNone) is used to indicate that it replaces none or any number of consecutive elements of a string (except character strings),..."

and as you pointed this out also in clauses B.1.3.1.1 and B.1.3.2.1.

I will take care a CR to correct the example.

BR, Gyorgy

________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Jesús Domínguez Colino
Sent: 2008. szeptember 25. 12:21
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Matching mechanisms * and ? inside charstrings


Dear all,

Reading the standard we don't have clear wether "?" and "*" can be used in charstrings as matching mechanisms without using a pattern.

There is one example in B1.4.1 where these mechanisms are used without using pattern, and this is also understood reading 15.7.3 and table 9 in 15.7:

template Mymessage MyTemplate:=
{
field1 := complement ({4,5},{1,4,8,9}) length (1 .. 6), // any value containing 1, 2, 3, 4,
// 5 or 6 elements is accepted provided it is not {4,5} or {1,4,8,9}
field2 := "ab*ab" length(13) // max length of the AnyElementsOrNone string is 9 characters
}

However, there are some other places where it says that they shall only be used with patterns, like B1.3.1.1 and B.1.3.2.1, or the grammar:

"If it is required to express the "?" wildcard in character strings it shall be done using character patterns
(see clause B.1.5). For example: "abcdxyz", "abccxyz" "abcxxyz" etc. will all match pattern "abc?xyz". However,
"abcxyz", "abcdefxyz", etc. will not."


What is the correct interpretation?

Thanks in advance,

--


Jesús Domínguez Colino

Consultor Senior







Pº de la Castellana, 182 - 10ª planta

28046 - Madrid

Tel.: +34 913531564

Fax: +34 913596179

www.mtp.es <www.mtp.es>

Please Log in to join the conversation.

Matching mechanisms * and ? inside charstrings 25 Sep 2008 10:46 #7438

  • Jes
  • Jes's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Thanks Gyorgy, for the prompt answer, and for taking care of the CR

Regards,
Jes

Please Log in to join the conversation.

  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin