Reply to note from Harry Binswanger <dmarc-noreply@xxxxxxxxxxxxx> Tue, 12 May 2026 13:01:55
-0400
Harry,
> One thing from Xy that is immensely valuable is the wildcards for
> search and replace. Wildstring and the Not (plus the suite of
> others) have eliminated the need for RegEx for my amateur uses.
I considered implementing this, and may still do so. But for now I'd like to push back on the idea
that regular expressions are not for "amateurs". Sure, regexes can be complex and
inscrutable; but most XyWrite-style wildcard searches are simple, and their regex equivalents are
simple, too. For starters, no wildcards are needed for the following:
carriage return:
SE "\n"
line feed:
SE "\r"
guillemets:
SE "\xAE", SE "\xAF" [rare outside of XyWrite]
For the other wildcards, the regex equivalents are straight-forward:
Wild letter:
SE/R "\w" [any "word" character]
Wild number:
SE/R "\d" [any "digit"]
Wild alphanumeric char:
SE/R "[\w\d]"
Wild separator:
SE/R "\s"
Any single char:
SE/R "."
Any one or more chars:
SE/R ".*"
Any sentence separator:
SE/R "[.?!]"
The "OR" wildcard is simply a vertical bar |:
SE/R "woman|girl"
The "NOT" wildcard is a bracketed group starting with a caret (^):
SE/R "y[^u]p" [Finds "yap", "yep", or "yip" but not
"yup"]
SE/R "y[^ou]r" [Finds "year" but not "your"]
Numerical wildcards are replicated with a number or a comma-separated range of numbers in curly
braces:
SE/R "yes{1,3}" [finds "yes" or "yess" or "yesss"]
Once these basic moves are in muscle memory, it's a short step to more-elaborate searches:
SE/R "wom[ae]n|girls?" [finds "woman" or "women" or "girl"
or "girls"]
SE/R "US{1,2}[AR]" [finds USA or USSR]
Easy, no? And more succinct than their equivalent Xy-style wildcard searches. And remember that your
need to learn about regular expressions only goes as far as your search needs. You can stay in the
shallow end of the pool and still have a jolly good swim.
--
Carl Distefano
cld@xxxxxxxxxx