How to match a semicolon in Visual Filters

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
jupe
Posts: 3446
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

How to match a semicolon in Visual Filters

Post by jupe »

I was wondering if anyone (especially Don ;) ) knows how or if it is possible to match a semi colon in VF syntax? I have knocked up a repro script that demo's various methods, I have tried others too but only included the obvious, the last one is successful, but I was hoping there was an exacting alternative:

Code: Select all

  goto <xy>;
  tag "semi; colon",, 1;
  $a = "You can see it doesn't work";
  filter "prop:#Tags: semi; colon";   // NO GO (EXPECTED)
  msg $a;
  filter "prop:#Tags: semi\; colon";  // NORMAL ESCAPE NO WORK
  msg $a;
  filter "prop:#Tags: semi[;] colon"; // RAISES ERROR 93
  msg $a;
  filter 'prop:#Tags: "semi; colon"'; // I THOUGHT QUOTING WOULD WORK
  msg $a;
  filter "prop:#Tags: semi? colon";   // WORKS
I know its unnecessary to use the prop prefix in that script but I am using it because what I really want to match is a semicolon (without substitution) in a non editable shell property, so it'll be required in that context, I am only using Tags for example purposes.

admin
Site Admin
Posts: 66102
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to match a semicolon in Visual Filters

Post by admin »

Try this: Tags:*;* | (mind the final space character)

Background 1 (from Help):

Code: Select all

The | has priority over ; so using | you can filter items containing the ; character:
Desktop|; | ,     = List all items on Desktop containing ";" or "," 
If you state only one pattern and this pattern contains a ; then you have to add another dummy | (mind the surrounding spaces) to avoid that the ; is treated as separator:
Desktop|; |       = List all items on Desktop containing ";"
Desktop|;a |      = List all items on Desktop containing ";a"
Desktop|*; * |    = List all items on Desktop containing "; "
Background 2:
For the "tags:" selector (or whatever you use to point to the "Tags:" column) there is no auto-surrounding by asterisks. That's why Tags:; | does not work here (unless the tag is just a semicolon). The pattern ; | does work in all other columns, and without any further selector it will match all files having a semicolon in the name.

jupe
Posts: 3446
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: How to match a semicolon in Visual Filters

Post by jupe »

Ahh thanks, I had actually tried that, but I must have forgotten the trailing space. doh!

Post Reply