Regular Expressions question, was about abbreviations

Richard Turner


I would like to learn how to apply this in other situations,

Could you give a brief explanation of what is happening here?  Why the double letters in brackets? 


To take Kevin’s issue, would [gg][dd] g d solve the ham radio model issue?


Thanks for your help in understanding this.



From: <> On Behalf Of Brian Vogel
Sent: Wednesday, September 16, 2020 10:17 AM
Subject: Re: Is there a way to not have Vocalizer substitute what it thinks works for abbreviations?



           What you suggest will work to force JAWS to pass what amounts to the full word for it's "known list of abbreviations" to the synth.  But it does not get the desired effect when it's off, and the synth itself has a "known list of abbreviations" that it expands on its own, which is what seems to be the issue here.  Some don't want the synth doing that, ever, and you would either have to have a way to instruct the synth to turn that feature off, or create exceptions that the screen reader would pass to the synth to force letter by letter announcement.


             Even though I said earlier it was beyond the scope of this discussion, I absolutely love playing with regular expressions, so here are three that would solve the street/saint issue along with the TV issue:

Regular Expression                     Substitution

[sS][tT]\.?\s(\w+)\s[sS][tT]\.?               Saint \1 Street


[sS][tT]\.?\s(\w+)(?!\s[sS][tT]\.?)          Saint \1


[Tt][Vv][Ss] Tee Veez

And the one related to television will accept the three letters side by side in any combination of capitalization as it is written now.





"He that cannot forgive others breaks the bridge over which he must pass himself,” and we forget that only grace can break the cycle of ancient hatreds among peoples. (It is notable that while I have regretted not granting grace to others, I’ve never once regretted extending it.)" - Edward Herbert




           I am going to wait on answering this on the group until after I get a definitive answer as to whether JAWS supports regular expression syntax in pattern matching for match/substitute pairs.  If it does, then discussing how regular expressions work, at least to some extent, is on-topic because it's something a JAWS user might employ.  If JAWS support this, then it's entirely off-topic for this group, though I'd be happy to discuss it privately.

           There are lots of beginners guides to regular expressions available on the web and many of them will do a better job walking folks through than I might.  

           But, because I said this earlier I'll repeat it again on the assumption that JAWS does support regular expression matching, to solve the original questioner's problem one would use:
                                 GD-(\d{1,})      or , if you don't care whether either the G or D or both are upper or lower case:  [Gg][Dd]-(\d{1,}) 
as the pattern match and:
                                 Gee Dee \1
as the substitution.

All of the above presumes you do not want the dash pronounced.  If you did then the substitution would be:  Gee Dee Dash \1

Brian - Windows 10 Pro, 64-Bit, Version 2004, Build 19041  

The purpose of education is not to validate ignorance but to overcome it.
       ~ Lawrence Krauss