Forum

    • Register
    • Login
    • Search
    • Categories

    File wildcard*

    General Questions
    regex wildcard wildcards
    4
    11
    68
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustk
      ustk last edited by ustk

      I thought this was working before, but it might be me...

      I'm trying to find files like "MyFilexxx.txt" using "MyFile*.txt" wildcard to get start+end of the file but it doesn't work...
      Normal behaviour or mistake is mine?

      Tired to press F5 in the forum...
      Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

      Casey Kolb d.healey 2 Replies Last reply Reply Quote 0
      • Casey Kolb
        Casey Kolb @ustk last edited by

        @ustk I struggled with this too. The regex seemed busted last time I tried.

        Casey Kolb
        Founder & CEO of Lunacy Audio
        Composer | Producer | Software Developer

        1 Reply Last reply Reply Quote 1
        • d.healey
          d.healey @ustk last edited by

          @ustk Mistake is yours. You need to remove the .txt after the * and filter for that separately in a loop. Or perhaps use regex.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          ustk 1 Reply Last reply Reply Quote 1
          • ustk
            ustk @d.healey last edited by

            @Casey-Kolb @d-healey thanks! It's for a FileSystem.browse so I'm not sure a loop is possible.
            Thought I could spend the rest of my life far from regex, perhaps a pint in my hand, rockin' back n forth, but things are what they areโ€ฆ ๐Ÿ™‚

            Tired to press F5 in the forum...
            Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

            d.healey 1 Reply Last reply Reply Quote 1
            • d.healey
              d.healey @ustk last edited by

              @ustk You might find this helpful - https://regex101.com/

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              Christoph Hart ustk 2 Replies Last reply Reply Quote 1
              • Christoph Hart
                Christoph Hart @d.healey last edited by

                AFAIK the file wildcard isnโ€˜t proper regex but a OS specifix syntax that is similar to what you would use in a terminal command.

                1 Reply Last reply Reply Quote 2
                • ustk
                  ustk @d.healey last edited by ustk

                  @d-healey Yeah thanks I already tried to learn, it is not that hard, I just don't like those regex ๐Ÿ™‚

                  Well, so something weird happens, because I can only match the extension with *

                  If I have this file MyFile_123.txt , the only thing that works is for the end of the name => *.txt (or *txt)

                  • MyFile* or MyFile_123* don't work
                  • *123.txt or *MyFile_123.txt don't even work

                  In short, everything that is before the dot isn't working

                  FileSystem.browse(FileSystem.Desktop, false, "MyFile*", doSomething); // doesn't give access to MyFile_123.txt
                  

                  @Christoph-Hart I'm pretty sure back in the days we could at least match the start of the name and not just the extension

                  Tired to press F5 in the forum...
                  Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                  d.healey 1 Reply Last reply Reply Quote 0
                  • d.healey
                    d.healey @ustk last edited by

                    @ustk It is the standard for most (if not all) file browsers that they show files based on extension. Open any app like a word processor or image editor, when you go to save/open it will filter by extension.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    ustk 1 Reply Last reply Reply Quote 1
                    • ustk
                      ustk @d.healey last edited by

                      @d-healey You're certainly right then, I really thought I have filtered from the start of the name before but I'm mistaken ๐Ÿ˜‰

                      Tired to press F5 in the forum...
                      Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                      1 Reply Last reply Reply Quote 0
                      • d.healey
                        d.healey last edited by

                        A little more info from the JUCE documentation

                        filePatternsAllowed: a set of file patterns to specify which files can be selected - each pattern should be separated by a comma or semi-colon, e.g. "" or ".jpg;.gif". The native MacOS file browser only supports wildcard that specify extensions, so ".jpg" is OK but "myfilename*" will not work. An empty string means that all files are allowed

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        ustk 1 Reply Last reply Reply Quote 2
                        • ustk
                          ustk @d.healey last edited by

                          @d-healey Youโ€™ve hit it right on the nose mate! Thanks for checking ๐Ÿ˜‰

                          Tired to press F5 in the forum...
                          Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          29
                          Online

                          803
                          Users

                          5.5k
                          Topics

                          51.7k
                          Posts