Forum
    • Categories
    • Register
    • Login

    Regex on windows

    Scheduled Pinned Locked Moved General Questions
    12 Posts 4 Posters 1.1k Views
    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.
    • A
      arminh
      last edited by

      I also don't know why strings in my path array in ScripWatchTable looks like this

      "C:\\Users\\armin\\AppData\\Roaming\\My Company\\Demo Plugin\\AudioFiles\\factory_1.wav",
      

      and when i Console.print it it looks normal (single slash)

      1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey
        last edited by David Healey

        Windows uses \ as a directory separator. Sensible operating systems use /. \ is also an escape character, so when you try to write a directory name on Windows you have to use \\ one is the directory separator, the other is the escape character to tell Windows that the other one is the directory separator and not an escape character :p

        Another solution (in the command line at least) is to place the path in quotes "" and just use one \

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        A 1 Reply Last reply Reply Quote 1
        • A
          arminh @David Healey
          last edited by

          @d-healey ok thanks for explanation but i still don't know how to fix it :D I hate regex.

          David HealeyD 1 Reply Last reply Reply Quote 1
          • David HealeyD
            David Healey @arminh
            last edited by

            @arminh said in Regex on windows:

            @d-healey ok thanks for explanation but i still don't know how to fix it :D I hate regex.

            I'm not good with regex which is why I avoided answering the question :p

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            A 1 Reply Last reply Reply Quote 0
            • A
              arminh @David Healey
              last edited by

              @d-healey anyway, thanks :D I'm currently in the moment that I can pull out a file extension :D Wish me luck.

              A 1 Reply Last reply Reply Quote 0
              • A
                arminh @arminh
                last edited by

                ANSWER IS

                [^\\\\]*$
                
                1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart
                  last edited by

                  If you need to distinguish the regexes based on the OS, use Engine.getOS()...

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    arminh @Christoph Hart
                    last edited by

                    @Christoph-Hart thanks :)

                    NatanN 1 Reply Last reply Reply Quote 0
                    • NatanN
                      Natan @arminh
                      last edited by

                      @arminh Bro, What This Regex Thing Stands For?
                      Where You Find Your Self To Use This Code?

                      David HealeyD 1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @Natan
                        last edited by

                        @Natanr https://en.wikipedia.org/wiki/Regular_expression

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - Public HISE tutorials
                        My Patreon - HISE tutorials

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

                        52

                        Online

                        2.1k

                        Users

                        13.0k

                        Topics

                        112.7k

                        Posts