Page 1 of 1

[SOLVED] message-id customstr

Posted: Mon May 14, 2007 3:47 am
by japanitrat
hello again!

i wonder, why Swift_Message::generateId ($idstring) does only allow characters and numbers?
even dots are not allowed, while swift is gerenating dots itself.

i wanna ask, if it is rfc-compliant to add "_-" to the regexp ?

(i need this, to differentiate two variables in the message-id)

Posted: Mon May 14, 2007 4:28 am
by Chris Corbyn
No underscores would be permitted but hyphens and dots are. It's dot-atomic which basically means this:

[a-zA-Z0-9\.-]

I'll ammend the pattern to:

/^(?<!\.)[A-Za-z0-9\.-]+(?!\.)$/

Your parameter will simply appear as the last dot-atomic part of the string before the @ sign.

Cheers,

d11

Posted: Thu May 17, 2007 3:46 am
by japanitrat
okay, so using dots to distinguish to or more variables in the individual message-id-string makes no sense, since swift is using them by itself and i dont wanna search by the dot no. x.

this is why i will search for the last dot in the local-part and then explode by the hyphen.

i nearly used underscores, thanks for the hint!