Community
    • Login

    Pythonscript :RuntimeError

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 918 Views 1 Watching
    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.
    • claudio pergolinC Offline
      claudio pergolin
      last edited by

      The following command in python script should delete any spaces in a local path:

      editor.rereplace (r "((\ w) +) ((\ s) *) \ / ((\ s) *) ((\ _) *) ((\ w) +) (\. html | \. htm) ", r" $ 1 \ / $ 7 $ 9 $ 11 ")
      

      if it weren’t for the following error:

      Traceback (most recent call last):
         File "C: \ Users \ Jack \ AppData \ Roaming \ Notepad ++ \ plugins \ Config \ PythonScript \ scripts \ $ variables.py", line 1, in <module>
           editor.rereplace (r "((\ w) +) ((\ s) *) ((\ s) *) ((\ w) +) (\. html | \ .htm)", r "$ 1 $ 7 $ 9 ") #document URL spaces
      : Ran out of stack space trying to match the regular expression.
      

      Any suggestions? thank you

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @claudio pergolin
        last edited by

        @claudio-pergolin said in Pythonscript :RuntimeError:

        Ran out of stack space trying to match the regular expression.

        This part of the error message is telling you that your regular expression search string is too complicated.

        I believe that your only option is to find a way to make it simpler.

        1 Reply Last reply Reply Quote 1
        • claudio pergolinC Offline
          claudio pergolin
          last edited by

          Hi, thanks for the reply. Now works. I just replaced “\ w” with [a-zA-Z0-9] which would be its equivalent. If it’s simpler, I don’t know, but it’s certainly synonymous.

          1 Reply Last reply Reply Quote 0
          • guy038G Offline
            guy038
            last edited by guy038

            Hello, @claudio-pergolin and All,

            You said :

            I just replaced “\ w” with [a-zA-Z0-9] which would be its equivalent. If it’s simpler, I don’t know, but it’s certainly synonymous.

            Well, not exactly !!

            For instance :

            • Open Notepad++

            • If necessary, select the Courier New font, in the Style Configurator

            • Open a new tab ( Ctrl + N )

            • If necessary, convert it as an UTF-8 encoded file ( Encoding > Convert to UTF-8 )

            • Paste this long line, below :

            !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƏƒƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǺǻǼǽǾǿəˆˇˉ˘˙˚˛˜˝̣̀́̃̉;΄΅Ά·ΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώЁЂЃЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёђѓєѕіїјљњћќўџҐґҒғҖҗҚқҜҝҢңҮүҰұҲҳҸҹҺһӘәӨөְֱֲֳִֵֶַָֹֻּֽ־ֿ׀ׁׂ׃אבגדהוזחטיךכלםמןנסעףפץצקרשתװױײ׳״،؛؟ءآأؤإئابةتثجحخدذرزسشصضطظعغـفقكلمنهوىيًٌٍَُِّْ٠١٢٣٤٥٦٧٨٩٪٫٭ٰٱٴپچژڤکگیەۤ۰۱۲۳۴۵۶۷۸۹ẀẁẂẃẄẅẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ‌‍‎‏–—―‗‘’‚‛“”„†‡•…

‰′″‹›‼‾⁄ⁿ₣₤₧₪₫€℅ℓ№™Ω℮⅓⅔⅛⅜⅝⅞←↑→↓↔↕↨∂∆∏∑−∕∙√∞∟∩∫≈≠≡≤≥⌂⌐⌠⌡─│┌┐└┘├┤┬┴┼═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬▀▄█▌▐░▒▓■□▪▫▬▲►▼◄◊○●◘◙◦☺☻☼♀♂♠♣♥♦♪♫fiflﬠשׁשׂשּׁשּׂאַאָאּבּגּדּהּוּזּטּיּךּכּלּמּנּסּףּפּצּקּרּשּתּוֹבֿכֿפֿﭏﭐﭑﭖﭗﭘﭙﭪﭫﭬﭭﭺﭻﭼﭽﮊﮋﮎﮏﮐﮑﮒﮓﮔﮕﯼﯽﯾﯿﰈﰉﰎﰒﰱﰲﰿﱀﱁﱂﱃﱄﱎﱏﱘﱙﱞﱟﱠﱡﱢﱪﱭﱮﱯﱰﱳﱴﱵﲎﲏﲑﲔﲜﲝﲞﲟﲠﲡﲢﲣﲤﲥﲦﲨﲪﲬﲰﳉﳊﳋﳌﳍﳎﳏﳐﳑﳒﳓﳔﳕﳘﳚﳛﳜﳝﴰﴼﴽ﴾﴿ﶈﷲﺀﺁﺂﺃﺄﺅﺆﺇﺈﺉﺊﺋﺌﺍﺎﺏﺐﺑﺒﺓﺔﺕﺖﺗﺘﺙﺚﺛﺜﺝﺞﺟﺠﺡﺢﺣﺤﺥﺦﺧﺨﺩﺪﺫﺬﺭﺮﺯﺰﺱﺲﺳﺴﺵﺶﺷﺸﺹﺺﺻﺼﺽﺾﺿﻀﻁﻂﻃﻄﻅﻆﻇﻈﻉﻊﻋﻌﻍﻎﻏﻐﻑﻒﻓﻔﻕﻖﻗﻘﻙﻚﻛﻜﻝﻞﻟﻠﻡﻢﻣﻤﻥﻦﻧﻨﻩﻪﻫﻬﻭﻮﻯﻰﻱﻲﻳﻴﻵﻶﻷﻸﻹﻺﻻﻼ
            
            • Open the Mark dialog ( Ctrl + M )

            • Tick the Purge for each search and Wrap around options

            • Un-tick all the other options

            • Select the Regular expression search mode

            • Now try, successively, the regexes [a-zA-Z0-9] and \w against this text : Quite different, isn’t it ?

            BTW, note that, in addition to Latin, Greek, Cyrillic, Hebrew and Arabic lowercase and uppercase letters, digits, letters-like and numbers-like characters, the \w regex also matches the underscore char ( _ ) !

            Best Regards,

            guy038

            1 Reply Last reply Reply Quote 2
            • claudio pergolinC Offline
              claudio pergolin
              last edited by

              thanks for the tip to both of you

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors