CultureInvariant question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AAaron123

    CultureInvariant question

    I'm trying to understand CultureInvarian t as it applies to Regex.

    I'd appreciate seeing a string that will be matched by another string when
    CultureInvarian t is set and not matched when it is not set.

    Or the reverse.

    I get many Goggle hits but the all assume the reader knows about Culture.

    I need to get oriented.

    Thanks


  • Steve Gerrard

    #2
    Re: CultureInvarian t question

    AAaron123 wrote:
    I'm trying to understand CultureInvarian t as it applies to Regex.
    >
    I'd appreciate seeing a string that will be matched by another string
    when CultureInvarian t is set and not matched when it is not set.
    >
    Or the reverse.
    >
    I get many Goggle hits but the all assume the reader knows about
    Culture.
    I need to get oriented.
    >
    Thanks
    Start with this link at MSDN, titled Comparing and Sorting Data for a Specific
    Culture:


    An example of a culture sensitive issue:

    "mailto".ToUppe r <"MAILTO"

    - if you are in Turkey. ;-)


    Comment

    • AAaron123

      #3
      Re: CultureInvarian t question

      When I first read it it seemed to me that if I'm comparing strings in a text
      editor I need not be concerned about culture because I'm only interested in
      equality or not equal. That's true isn't it? If I'm doing case sensitive
      comparisons it seems to me the bit are just compared and are either equal or
      not.

      However, it occurred to me that I don't know how RegEx does case insensitive
      comparisons. Does it convert to upper or lower and if it does, does that
      make culture important since again, we are just looking for equality.

      Thanks

      PS
      I read the site you suggested and also
      Culture-Insensitive String Operations.

      But it just makes suggestions about when to use or not use
      culture-insensitive string operations. I can't imagine what a
      culture-insensitive operation does unless there are some fixed rules that
      are applied with out regard to the culture in effect.

      If that's the case is "mailto".ToUppe r <"MAILTO" case insensitive equal
      even in Turkey?

      "Steve Gerrard" <mynamehere@com cast.netwrote in message
      news:05SdnbsVGu rm7p_VnZ2dnUVZ_ q2hnZ2d@comcast .com...
      AAaron123 wrote:
      >I'm trying to understand CultureInvarian t as it applies to Regex.
      >>
      >I'd appreciate seeing a string that will be matched by another string
      >when CultureInvarian t is set and not matched when it is not set.
      >>
      >Or the reverse.
      >>
      >I get many Goggle hits but the all assume the reader knows about
      >Culture.
      >I need to get oriented.
      >>
      >Thanks
      >
      Start with this link at MSDN, titled Comparing and Sorting Data for a
      Specific Culture:

      >
      An example of a culture sensitive issue:
      >
      "mailto".ToUppe r <"MAILTO"
      >
      - if you are in Turkey. ;-)
      >
      >

      Comment

      • Cor Ligthert[MVP]

        #4
        Re: CultureInvarian t question

        AAaron,

        I do not know from what country you are, however be aware that what you read
        about cultures on Internet is mostly done by English speaking people from
        which a lot think that the whole world is only speaking English.

        The culture is in most cases the setting of a computer, you should not set
        the culture for a program that is used in different cultures.

        If you use a program by instance created in the USA and it would be used in
        Canada, then the most stuppid thing you can do is set it to the region CA,
        because in Canada is the Brittish (English) and French culture used. The Net
        program will automaticly behave like that because it is set like the user in
        Canada shows things as he/she is used to.

        Cor

        "AAaron123" <aaaron123@road runner.comschre ef in bericht
        news:eOlh5tZnIH A.3780@TK2MSFTN GP06.phx.gbl...
        I'm trying to understand CultureInvarian t as it applies to Regex.
        >
        I'd appreciate seeing a string that will be matched by another string when
        CultureInvarian t is set and not matched when it is not set.
        >
        Or the reverse.
        >
        I get many Goggle hits but the all assume the reader knows about Culture.
        >
        I need to get oriented.
        >
        Thanks
        >

        Comment

        • AAaron123

          #5
          Re: CultureInvarian t question

          I don't know how RegEx does case
          insensitive comparisons. Does it convert to upper or lower and if it
          does, does that make culture important since we are just
          looking for equality.

          When using RegEx when does it make sense to use CultureInvarian t?

          Thanks

          "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
          news:750C9FB8-0C2B-48C7-A7D9-3B92E1106567@mi crosoft.com...
          AAaron,
          >
          I do not know from what country you are, however be aware that what you
          read about cultures on Internet is mostly done by English speaking people
          from which a lot think that the whole world is only speaking English.
          >
          The culture is in most cases the setting of a computer, you should not set
          the culture for a program that is used in different cultures.
          >
          If you use a program by instance created in the USA and it would be used
          in Canada, then the most stuppid thing you can do is set it to the region
          CA, because in Canada is the Brittish (English) and French culture used.
          The Net program will automaticly behave like that because it is set like
          the user in Canada shows things as he/she is used to.
          >
          Cor
          >
          "AAaron123" <aaaron123@road runner.comschre ef in bericht
          news:eOlh5tZnIH A.3780@TK2MSFTN GP06.phx.gbl...
          >I'm trying to understand CultureInvarian t as it applies to Regex.
          >>
          >I'd appreciate seeing a string that will be matched by another string
          >when CultureInvarian t is set and not matched when it is not set.
          >>
          >Or the reverse.
          >>
          >I get many Goggle hits but the all assume the reader knows about Culture.
          >>
          >I need to get oriented.
          >>
          >Thanks
          >>
          >

          Comment

          • Cor Ligthert[MVP]

            #6
            Re: CultureInvarian t question

            No lower and upper case don't have any thing to do with cultures.

            Character Codesets and the way date and times are represented as string is
            more where the CultureInfo is for.

            While the first is for all west European languages 1251

            Cor

            "AAaron123" <aaaron123@road runner.comschre ef in bericht
            news:e0iGadinIH A.4536@TK2MSFTN GP06.phx.gbl...
            I don't know how RegEx does case
            insensitive comparisons. Does it convert to upper or lower and if it
            does, does that make culture important since we are just
            looking for equality.
            >
            When using RegEx when does it make sense to use CultureInvarian t?
            >
            Thanks
            >
            "Cor Ligthert[MVP]" <notmyfirstname @planet.nlwrote in message
            news:750C9FB8-0C2B-48C7-A7D9-3B92E1106567@mi crosoft.com...
            >AAaron,
            >>
            >I do not know from what country you are, however be aware that what you
            >read about cultures on Internet is mostly done by English speaking people
            >from which a lot think that the whole world is only speaking English.
            >>
            >The culture is in most cases the setting of a computer, you should not
            >set the culture for a program that is used in different cultures.
            >>
            >If you use a program by instance created in the USA and it would be used
            >in Canada, then the most stuppid thing you can do is set it to the region
            >CA, because in Canada is the Brittish (English) and French culture used.
            >The Net program will automaticly behave like that because it is set like
            >the user in Canada shows things as he/she is used to.
            >>
            >Cor
            >>
            >"AAaron123" <aaaron123@road runner.comschre ef in bericht
            >news:eOlh5tZnI HA.3780@TK2MSFT NGP06.phx.gbl.. .
            >>I'm trying to understand CultureInvarian t as it applies to Regex.
            >>>
            >>I'd appreciate seeing a string that will be matched by another string
            >>when CultureInvarian t is set and not matched when it is not set.
            >>>
            >>Or the reverse.
            >>>
            >>I get many Goggle hits but the all assume the reader knows about
            >>Culture.
            >>>
            >>I need to get oriented.
            >>>
            >>Thanks
            >>>
            >>
            >
            >

            Comment

            Working...