http://qs321.pair.com?node_id=11143477


in reply to Re: Unable to constrain the effect of a negative lookahead
in thread Unable to constrain the effect of a negative lookahead

Hi Polyglot,

That's a brilliant approach. I had not thought about setting the /e regex qualifier and then putting code to be executed in the regex upon the finding of a match. That certainly opens the door to a broad span of possibilities. I had gone with the approach of splitting $SYSPBUFF into two parts one before and one beginning with the first presence of "batch =". The /e regex qualifier approach has much appeal in that with the (?=batch\s*=) lookahead it already automatically does that splitting on the fly while preserving the value of $SYSPBUFF other than for the specific subpatterns being sought. I will try creating a new version of my real world project code using the approach you've put forth.

fireblood

P.S.Just out of curiosity, how many languages do you speak and what are they? I'm a native speaker of US English and a tiny fraction of Cherokee, and also took courses in German, Chinese, Hebrew, and Vietnamese in high school and college. Each language studying experience not only provides access to the language, but also to the music, food, dress, customs, and other aspects of others' cultures. I think that people who are polyglottal are also polycultural.

Cheers!

  • Comment on Re^2: Unable to constrain the effect of a negative lookahead

Replies are listed 'Best First'.
Re^3: Unable to constrain the effect of a negative lookahead
by Polyglot (Chaplain) on May 01, 2022 at 00:51 UTC

    fireblood,

    Yes, every language is a culture. I'm a native speaker of English, of course, and perhaps one could say a "half-native" speaker of Spanish (fluent and have native accent due to early childhood exposure). Beyond that, I speak/read Thai, Lao, and elemental Mandarin, can type Burmese Karen, am learning Hmong, can understand about 60-80% of written French (I studied it some in college), and I've completed multiple courses in the Biblical languages, i.e. Ancient Hebrew, Greek, and Aramaic. (Hebrew is fascinating, despite its complexity. Chinese and Hebrew are both very difficult to master, but I would rank Hebrew as more difficult than Chinese. The only difficulty with Chinese is its 86,000+ ideograms; its grammar doesn't hold a candle to Hebrew for complexity.) Of course, these are only "human" languages--and I think I could add a few computer languages to the list. It seems much of my life has revolved around language. When it comes to programming, I feel rather amateur; I am limited to the realm of the concrete, as I seem to have no understanding of the abstraction (think OOP: objects, references, and the like). Naturally, as with most of the human languages, I have picked up computer programming all on my own. Maybe if I had taken courses in it I would be better off.

    In general, Asian languages are inferior, despite their surface complexity. They lack plurals, have no verb conjugation, and most lack even word-spacing between words. Asian languages seem to be just beginning to adopt punctuation, and their vocabulary is often limited to the real and concrete, with many deficiencies showing up in the philosophical and abstract terminologies. For example, there are no words for "character" or "soul" or "faith" in Thai or Lao, and even their word for "God" is just borrowed from the word for "king." Thai and Lao have no: of, lest, never, either, neither, nor, etc. ("never" can be used for a non-event in the past, but there is no way to address the future by this concept), and there is no grammatical structure for differentiating between restrictive and non-restrictive clauses. Essentially, many concepts are non-translatable into the language, so "lost in translation" takes on a whole new meaning. There is no word for "brother" or "sister" because those words imply equality, and there is no equality within the culture. One is forced by the language to specify "older brother" or "younger brother"; or to imply a plurality as in "older-younger" = brothers and sisters. Complex concepts are made by the combining of simple words. In Chinese, saying "East-West" (dtong-shi/東西) is how one expresses "things." In Thai/Lao, saying "is go not can" is how one says "impossible." With any of the unspaced alphabetic Asian languages, speed reading is impossible, and reading in general is discouraged within the language. Very few Thai or Lao people enjoy reading, and their education suffers as a result. Chinese, being a different writing system, may be a little easier to read, once learned; but one must study the characters continuously through school, and no one knows them all. Even among the Chinese, I have yet to hear of a speed reader. I wonder if it is possible.

    Chinese translators have to be good at math, too. Chinese figures are chunked by 10,000's, whereas Western figures are divided by 1,000's. It can take a few moments to perform the mental conversions between them: for example, 70 thousand becomes 7 ten-thousands --> that's an easy example; but it gets more complex when one adds more digits....say, 7.5 million (7,500,000 --> 750 ten-thousands).

    Language is certainly intriguing at times.

    Blessings,

    ~Polyglot~

      Hi Polyglot, that's a very insightful post. I'm very impressed!

      Thanks very much (or should I say 非常感谢).


      Take care,
      Fireblood

      ᏗᏓᏲᎵᎲ ᏛᎦᎴᏂᏍᎬ