Re: Weird Abbreviation Processing Mid-word?


Mohamed
 

Essentially, the synth has a rule to expand abbreviated dates like 2 Sept to their more natural form. The problem is that the synth fails to take into account that there may be extra text after the abbreviated month, resulting in the weird expansions described here. The double spacing between the number and the word seems to get around the issue.

On 10/11/2021 10:49 AM, Brian Vogel wrote:
On Sun, Oct 10, 2021 at 10:29 PM, Mohamed wrote:
\b(\d+) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)([a-z]+)

Replacement.
\1  \2\3
-
Mohamed,

Would this actually work?  [I don't have time to test]

I ask because what you're handing the synth, reconstructed, is precisely what it would have been handed anyway, given that \1 will be the number, you've placed a space after it, and \2\3 would be the original full word following.  I'm not criticizing the regex formation, but the substitute and the original appear, to me, to be the same thing.

If it's the synth that's screwing this up, it's being given the same thing to screw up.
 
--

Brian - Windows 10, 64-Bit, Version 21H1, Build 19043  

The ignorance of one voter in a democracy impairs the security of all.

         ~ John F. Kennedy

 

Join nvda@nvda.groups.io to automatically receive all group messages.