Forum
    • Categories
    • Register
    • Login

    File wildcard*

    General Questions
    regex wildcard wildcards
    4
    11
    150
    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.
    • ustkU
      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?

      I can't help pressing F5 in the forum...

      Casey KolbC d.healeyD 2 Replies Last reply Reply Quote 0
      • Casey KolbC
        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.healeyD
          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

          ustkU 1 Reply Last reply Reply Quote 1
          • ustkU
            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… :)

            I can't help pressing F5 in the forum...

            d.healeyD 1 Reply Last reply Reply Quote 1
            • d.healeyD
              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 HartC ustkU 2 Replies Last reply Reply Quote 1
              • Christoph HartC
                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
                • ustkU
                  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

                  I can't help pressing F5 in the forum...

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    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

                    ustkU 1 Reply Last reply Reply Quote 1
                    • ustkU
                      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 ;)

                      I can't help pressing F5 in the forum...

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        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

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

                          @d-healey You’ve hit it right on the nose mate! Thanks for checking ;)

                          I can't help pressing F5 in the forum...

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

                          28

                          Online

                          1.2k

                          Users

                          7.9k

                          Topics

                          71.2k

                          Posts