Filtering with regex

Hi.
I'm trying to filter a lister containing 20,000+ files, to show only those files which have authors whose last names begin with R.

Now with my limited regex skills, the filter I attempted was

R?, (and then a space character)

It looks like case-insensitive mode is the default mode, so how would I make it see only uppercase and restrict the search to

Racky, Bob
Rinehart, Mary
Rube, Dillard

and avoid results such as

Barry, Skippy
Clarence, Tom
Racky, Bob
Ricky Rover and the Runabout Rabbit
Rinehart, Mary
Rube, Dillard
Serin, Paul

or would I solve my problem with a "beginning of line" anchor such as "^R"
(I couldn't get that to work either)

Thanks

Regex apparently is not supported in the Filter Bar.

[url]Filter bar: use of regular expression]

and from the manual:

"The filter string uses the standard pattern matching syntax"

thx

looks like lots of filtering work for me, then

Sorry, I gave you the problem with using regex, but not a solution.

Turn off Filter Bar > Partial Matching in Preferences, and then use the wildcard:

R*

If I could just filter with case-sensitivity, then standard pattern matching syntax would be sufficient.

Standard pattern matching should already sufficient. Just use R* with partial filtering turned off, as MrC suggests just above.

No case-sensitivity in Filter Bar.

However, I would have expected that Case sensitivity in Find's simple panel would have worked, but it doesn't seem to work for me:

Thanks for the efforts.
The problem with turning off partial matching is that I also wanted to include as a criteria the "comma space" after the last name, which is the surest indication that I'm looking at a last name and not just any old string beginning with "R"

In that case, use Find's Advanced Mode, with Regular Expressions. Start with something like:

^R\w*,

which is Beginning of Line, R, any number of word characters, followed by comma. Alternatively,
instead of looking for word characters (which are limited), restrict to non-whitespace, non-comma::

^R[^\s,]*,

Can't you just search for "R*, *" (without the quotes) in the filter bar, with partial matching off?

BTW, the case sensitive option in the Find panel mentioned above only applies to the Containing Text field directly above it, not the Name Matching field higher up.

Thanks sir.

The standard matching gets me close enough to start working, but I attached an image
to show the other results it admits as well...

Partial matching must still be on in that screenshot as there's no way F*, * should match a name starting with G (or anything other than F).

!!!
have been flipping partial matching on and off so much during this exercise that I got mixed up.

Thanks.
Easier now.

Is this the right time for a feature suggestion?
I BREATHE through the Filter bar, there's one at the bottom of each of my listers.
How about, to the right of the text field, a check box with a "R" as a label, to turn regex on and off.
That would really rock.

Then, for this question, instead of going into Prefs to switch off partial matching, you could just tick the R box and start with a caret anchor as MrC suggested, e.g. ^R[[:alpha:]]*,

For those who want that, you could also have a "P" and a checkbox for partial matching.
Last, way in the future, if someone complains that the checkboxes clutter the interface, an option in Prefs to show them or not to show them.

Anyone else like that?

1 Like

yeh!