Re: NVDA and Fractions


 

Cearbhall,

          There are *lots* of online resources for regular expressions, but if you can lay your hands on the O'Reilly [publisher of "all things Unix"] book entitled Mastering Regular Expressions by Jeffrey E. F. Friedl that would not be a bad place to start.  Here are three different cheat sheets that I found helpful when I was trying to refresh my memory about how these things work.  One of the trickiest concepts is that you can have a regular expression match zero or more occurrences of a given character, which seems very odd, but if you think about how time is conventionally written out in many instances, there is no leading zero before 10 AM (or PM) and the one may or may not be there in any given instance of the time, so you need to be able to match zero or more occurrences of the digit 1 at the start.

https://www.cheatography.com/davechild/cheat-sheets/regular-expressions/ 

http://www.rexegg.com/regex-quickstart.html 

http://www.regular-expressions.info/reference.html 

           I have to warn you that it generally takes a bit of time to wrap one's head around regular expression syntax.  The nice thing is that there are websites that allow you to test the regular expression you've put together against a pattern to see if it will match it and even some that will allow you to specify a replace option so that you can see precisely what you'd get as a replacement by piecing together bits of the original string in different order, with different separators, etc.  Here is the site that I preferred for that purpose:

http://www.freeformatter.com/regex-tester.html

--
Brian

Here is a test to find out whether your mission in life is complete.  If you’re alive, it isn’t.

    ~ Lauren Bacall

    


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