regex - Exclude expressin '?!' cannot be validated -


in xsd schema, there 1 particular regex <xs:pattern value="(?!tr)[a-z]{2}"/> pattern causes error. want ignore 'tr' , match other country codes. although regular expression works fine in several online editors, eclipse says:

invalidregex: pattern value '(?!tr)[a-z]{2}' not valid regular expression. reported error was: 'this expression not supported in current option setting.'

despite it's simple expression, cannot figure out why cannot validated. error, cannot deploy xsd file service bus. there problem aclipse or sth else?

all advises appreciated!

it works desired

xml schema regex flavor not support lookarounds. non-lookaround version of regex is

[a-su-z][a-z]|[a-z][a-qs-z] 

or, using character class subtraction:

[a-z-[t]][a-z]|[a-z][a-z-[r]] 

see regex demo

just note used ^ , $ in demo because flavor pcre there. in xsd pattern, regex anchored default, no ^ , $ necessary.

pattern details:

  • [a-su-z] (or [a-z-[t]])- uppercase ascii letter other thant`
  • [a-z] - uppercase ascii letter
  • | - or
  • [a-z] - uppercase ascii letter
  • [a-qs-z] (or [a-z-[r]]) - uppercase ascii letter other r

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -