AA

Featured products

    Popular categories

      Trending searches

        Articles

          Blog

            Products

              Categories

                Suggested searches

                  Searching…
                  No results
                  Something went wrong.
                  ↑↓ Select↵ OpenEsc Close search
                  • English
                  • Čeština
                  • Deutsch
                  • Español
                  • Français
                  • Italiano
                  • Polski
                  • 日本語
                  • Orders
                  • Address
                  • In-stock Alerts
                  • My Courses
                  • Subscription
                  • Edit Account
                  • 3D printers9+▾

                    3D printersnew

                    newPrusa CORE One L+Learn more
                    newPrusa CORE One+ (Gen 2)Learn more
                    newPrusa CORE One L+ INDX 8-ToolnewPrusa CORE One+ (Gen 2) INDX 8-ToolPrusa CORE One L+: Critical InfrastructureOriginal Prusa MK4SnewOriginal Prusa XL+Original Prusa XL+: Critical Infrastructure

                    Printer upgrades

                    newINDX Conversion KitsnewPrusa CORE One L to CORE One L+ upgradenewPrusa CORE One+ to Prusa CORE One+ (Gen 2)newPrusa XL to Prusa XL+ Upgrade
                    Prusa Reward ProgramLove your Prusa printer? Share your experience and earn $30 Prusa e-shop vouchers.
                    How to Choose a 3D Printer?We’ll walk you through the basics to find the exact machine for your space, budget, and ideas.
                    Free E-bookDownload a free e-book Basics of 3D Printing with Josef Prusa and make your first steps in 3D printing world
                    Original Prusa Printable PartsCollections of printable spare parts for Original Prusa 3D printers and upgrades.
                    Shipping informationRegularly updated info about the current manufacturing capacity and delivery times of our printers.
                    Custom 3D PrintingProfessional custom 3D printing from various materials according to your requirements.
                  • Materials▾

                    Filaments

                    PrusamentPLAPETGASA / ABSPC (Polycarbonate)PA (Nylon)FlexCompositesSpecialMaterials clearance sale

                    Resin

                    Prusament ResinResin Cleaner
                    Filament GuideCheck my Prusament Spool
                    Prusament.com
                  • Parts & Accessories▾

                    Accessories

                    EnclosuresNozzlesPrint SheetsEssential AccessoriesCameras & AddonsTools & CraftingAdhesives

                    Spare parts

                    Merchandise

                    Spare parts - All PrintersCORE OneMK4/S & MK3.9/SMK3/S/+XL
                    Merch
                  • For Business▾
                    Prusa Pro HT90Prusa Pro SLXPrusa Pro AFSPrusa Pro Medical OneOriginal Prusa XLOriginal Prusa XL: Critical Infrastructure
                    Prusa CORE One+Learn more
                    Prusa CORE One LLearn more
                    Prusa CORE One L: Critical Infrastructure Edition

                    3D Printing for

                    Manufacturing and R&DAutomotive IndustryHealthcareEducation and Academic ResearchArchitects and DesignersFilm IndustryCritical Infrastructure

                    3D Printing Stories

                    • How 3D printing started: About Rep-rap and open-source with Adrian Bowyer
                    • Teaching mathematics redefined with 3D printing at JKU Linz
                    • The story behind the LTT screwdriver
                    • Victoria Hand Project: Changing Prosthetic Care with 3D Printing
                    Official Prusa Resellers
                    Sustainability
                    Prusa Education
                    Contact and Inquiry
                    Custom 3D Printing
                    ISO Certified
                  • Software▾
                    PrusaSlicer

                    PrusaSlicerPrusaSlicer

                    PrusaSlicer is an open-source, feature-rich, frequently updated tool that contains everything you need to export the perfect print files for your 3D printer.

                    WindowsMacOSLinux
                    Prusa Connect

                    Prusa Connect

                    Prusa Connect is a cloud service enabling remote control and monitoring of your 3D printers, offering secure data handling, easy setup, and support for managing multiple printers from anywhere.

                    Log in to Connect
                    Prusa.app

                    Prusa.app

                    Control your printer/s remotely from anywhere using the Prusa Connect technology behind. Prusa.app brings a new level of Prusa printer experience to Android and iOS phones.

                    Try it now!
                    Drivers & FirmwareDownload the latest firmware and drivers for your 3D printer.
                    PrusaSlicer Support
                    Prusa Connect Support
                  • 3D Models▾
                    3D PrintersArt & DesignHobby & MakersHouseholdTabletop MiniaturesToys & GamesPrintables Store

                    Popular 3D models

                    • Strong garden hose holder
                    • Prusa Spool Bot
                    • Build Tray — Modular Organizer for Assembly, Disassembly and Maintenance
                    • Broom Holder
                    • Octagon Fabric
                    • Prusa CORE One ? (Mimic Skin)

                    Design Contests

                    • De Prototipo a Producto: Accesorios para Cámaras8/1/2026 – 9/14/2026
                    • Vuelta al Cole 20268/21/2026 – 9/6/2026
                  • Community▾

                    Upcoming Events

                    • Maker Faire Tokyo 20269/5/2026 – 9/6/2026 · Tokyo, Japan · Prusa Team
                    • IFA 20269/4/2026 – 9/8/2026 · Berlin, Germany · Prusa Team
                    • 3D Printopia 20269/26/2026 – 9/27/2026 · Pennsylvania, United States · Prusa Team
                    • Maker Faire Bay Area9/25/2026 – 9/27/2026 · Kalifornie, United States · Prusa Team

                    Prusa Forum

                    • Vent doesn't close for an ASA print
                    • Alignment tool?
                    • Is this spam?
                    Prusa World MapPrusa World MapFind local 3D printing users and explore the community around you.
                  • Help▾
                    Guides & TutorialsPrusaSlicerPrusa ConnectMaterials

                    Printer Model

                    CORE One INDXCORE One LCORE One+CORE One

                    Hardware Troubleshooting

                    • Selftest failed (CORE One/+)
                    • Clogged nozzle (CORE One, CORE One L, XL, MK4/S, MK3.9/S)
                    • Adjusting belt tension (CORE One/+, CORE One INDX, CORE One L/+)
                    • Prusa Connect and PrusaLink explained

                    Drivers & Firmware

                    INDX familyCORE One familyMK4 familyXL familyMMU familyPRO family
                  • Courses▾

                    Become an expert in 3D printing

                    Prusa Academy offers online courses on various 3D printing related topics. Each course features:

                    • easy-to-read text with many pictures and short videos
                    • links for inspiration and further study
                    • quizzes for testing your knowledge along the way
                    • certificate of completion
                    Browse all coursesMy courses library
                    • 3D Modeling in Autodesk Fusion
                    • PrusaSlicer Masterclass – Beginner to Advanced
                    • Complete Guide to 3D Print Postprocessing, Painting, and Detailing
                    • Airbrush Your 3D Prints: From Basics to Advanced Tricks
                  • Blog▾
                    • PrusaSlicer 3.0 Preview – Built for the Future of 3D Printing
                    • Prusa CORE One+ (Gen 2) INDX, Shipping Has Started, Complete Printers Open for Orders
                    • Better Prints, Easier Use: Prusa XL+, CORE One L+ and CORE One+ (Gen 2), Our Big Product Upgrade
                    E-Book: Basics of 3D Printing
                  • Company▾

                    About Prusa Research

                    We are the largest maker of 3D printers in Europe and the United States.

                    Founded as a one-man startup in 2012 by Josef Prusa, a Czech hobbyist, maker, and inventor. In just 15 years, we've grown into a company of more than 1,200 people. Every month, we design, build, and ship over 10,000 innovative and secure 3D printers from our headquarters in Prague, Czech Republic, and Delaware, USA, to users in more than 160 countries.

                    Watch a video and find out how Prusa Research was born and what we achieved within only 10 years!

                    About UsTimelineSustainabilityOpen-source
                    About Us
                    Contact Us
                    Logo and Photos
                    ISO Certified
                  1. Support
                  2. Original Prusa MINI+
                  3. Advanced features
                  4. G-code substitutions
                   

                  Contents

                  • Regular expression syntax
                  • Example

                  Blog

                  • PrusaSlicer 3.0 Preview – Built for the Future of 3D Printing
                  • Prusa CORE One+ (Gen 2) INDX, Shipping Has Started, Complete Printers Open for Orders
                  • Better Prints, Easier Use: Prusa XL+, CORE One L+ and CORE One+ (Gen 2), Our Big Product Upgrade

                  Newsletter

                  Signup and get our monthly squeeze on updates, blog, printables and much more.

                  By clicking, you agree to receive our newsletter.

                  This site is protected by reCAPTCHA Enterprise and the Google Privacy Policy and Terms of Service apply.

                  Strong garden hose holder
                  E-shop
                  • 3D Printers
                  • Printer Upgrades
                  • Filaments
                  • Accessories
                  • Prusa Merchandise

                  © Prusa Research a.s.

                  Printables
                  • 3D Models
                  • Store
                  • Clubs
                  • 3D Design Contests
                  • Brands
                  Community
                  • World Map
                  • Forum
                  • User Groups
                  • Events
                  Help
                  • Prusa Help
                  • Prusa Academy
                  • 3D Printing Calculators
                  Software
                  • PrusaSlicer
                  • Prusa.app
                  • Prusa Connect
                  • Drivers and Software
                  Company
                  • About Us
                  • Blog
                  • Official Prusa Resellers
                  • Contact Us
                  • Certified for ISO 9001, ISO 14001, ISO 45001
                  • General Terms and Conditions
                  • General Terms and Conditions of Use of the PRUSA Websites
                  • Privacy Policy
                  • Information about cookies
                  • Customer Complaints Policy
                  • Status Page
                  • Do Not Sell or Share My Personal Information
                  • Supplemental Statements
                  • General Terms and Conditions
                  • General Terms and Conditions of Use of the PRUSA Websites
                  • Privacy Policy
                  • Information about cookies
                  • Customer Complaints Policy
                  • Status Page
                  • Do Not Sell or Share My Personal Information
                  • Supplemental Statements

                  © Prusa Research a.s.

                  JOSEF PRUSA®, PRUSA RESEARCH®, PRUSA POLYMERS®, PRUSA ORANGE®, PRUSA 3D ® AND PRUSAMENT® are registered trademarks of Prusa Development a.s. used by Prusa Research a.s. under licence from Prusa Development a.s.

                  G-code substitutions

                  Relevant for

                  MK4 family
                  XL family
                  MINI family
                  MK3 family
                  MK3.5 family
                  +
                  7 comments
                  Article is also available in following languages
                  English
                  Čeština
                  Polski
                  Deutsch
                  Français
                  Español
                  Italiano
                  日本語
                  This feature will be available in PrusaSlicer 2.4.1

                  PrusaSlicer offers simple G-Code post-processing by specifying find and replace pairs, with optional regex matching, case sensitivity and whole word matching, similar to what common text editors offer. Regular expressions are very powerful and versatile tool that allows to set up even quite complicated substitutions. If you need more complicated post-processing, it is possible to use an external post-processing script instead.

                  The feature accessible from Print Settings -> Output options.

                  The G-Code is processed before it is previewed, so your changes will be visible in the G-Code preview. It may be helpful to turn on 'Verbose G-Code' to make PrusaSlicer generate extra annotations, which you can then match with a regex.

                  Regular expression syntax

                  Regular expression syntax of Perl is supported as described in boost Perl regular expression syntax, where a "single line" modifier mimics the Perl's s/ modifier. With regular expressions active, the "Replace with" pattern supports the "extended" syntax as described in boost extended format syntax. Lookahead and lookbehind are supported by the regular expression engine, but only for fixed length patterns. With regular expression disabled, n, r, t, and placeholders are supported in both "Find" and "Replace with" patterns similarly to Notepad++'s "extended" syntax.

                  The G-code find/replace post-processor processes G-code in blocks, where a single G-code block is generated for each layer starting with the Z up to move to the next layer. Multiple find/replace patterns are applied one by one to one G-code block before processing the next G-code block. Matching multi-line patterns is possible, however only inside one G-code block, most likely inside a single layer. Regular expressions are powerful but tricky, thus we recommend the regular expressions 101 online playground to get familiar with regular expressions and to test and fine tune the regular expressions modifying G-code before entering them into PrusaSlicer. Don't forget to switch the regex flavor to ECMAScript in the regular expressions 101 online playground.

                   

                  Example

                  An example of a quite powerful G-code modification by a reasonably complex regular expression: Increase the extrusion rate of top solid infill from the default 95 percent to 98 percent.
                  Find:
                  Replace with:
                  Modifiers: regexp, single line

                  Was this article helpful?
                  This action is available only to registered users. Please log-in.

                  Topics

                  • PrusaSlicer 2.9 (Legacy)
                    • Advanced features
                      • Per model settings
                      • Color change
                      • Modifiers
                      • Reload from disk
                      • Insert pause or custom G-code at layer
                      • Negative volume
                      • Simplify mesh
                      • Post-processing scripts
                      • Shape Gallery
                      • Compare presets
                      • G-code substitutions
                      • Text tool
                      • SVG embossing tool
                      • Pressure Advance
                    • About PrusaSlicer
                    • Configuration and profiles
                    • User interface
                    • Input/output
                    • Left toolbar
                    • Top toolbar
                    • Print settings
                    • Filament settings
                    • Printer settings
                    • Multi-material slicing
                    • SLA slicing
                    • Other (PrusaSlicer)

                  7 comments

                  Log in  to post a comment
                  TeknikFrik
                  •
                  The example... I believe some new-line backslashes have been lost? Should it not read:

                  Find:
                  (;TYPE:Top solid infill\n)(.*?)(;TYPE:|$)(?!Top solid infill)
                  Replace:
                  ${1}M221 S98\n${2}M221 S95\n${3}
                  Reply
                  Canoe
                  •
                  For a mk4 mmu3

                  I want to add in a particular g-code substitution for all my slicing.
                  Currently, I have to put it in via the print settings->substitution tab, by copy/pasting each time I start up Slicer. Or else I have to find and replace in the g-code files. Or else I have to start with a previous *.3mf file and then read in the *.stl file I really want. Since I want the same substitution every time, this is a nuisance.

                  I have not been able to find the system's global "config file" or "parameters" . Which must exist, but where?

                  The g-code substitution I need is from the stock: "M708 A0x0b X5 ; extra load distance"
                  To the desired: "M708 A0x0b X10 ; extra load distance"
                  because for some reason, on my MK4 the filament needs to go a bit further forward in to the gear box.
                  Reply
                  Infinitymodular
                  •
                  I find this works with the example above to change the extrusion_multiplier for the top layer infill... I am trying to use the [extrusion_multiplier] placeholder value in the <replace> section, in order to offset the flow rate from the configured extrusion multiplier. Is this possible? It just seems to take the exact text in the replace field and replace with that. No placeholder injection. 
                  Reply
                  Scott Gartner
                  •
                  In PrusaSlicer 2.7.1 I can't get this feature to work at all.  I tried with and without regular expressions, I tried with and without comments, I get the following line output in the gcode, but no actual replacements are made (I tried valid substitutions as well):
                  ; gcode_substitutions = M73;xxxxxx;;
                  This was the setting I was hoping to make work:
                  ; gcode_substitutions = "(M73\\s+P[0-9]+\\s+R[0-9]+)\\n";"${1} ;LAYER_CHANGE_TRIGGER_CAMERA\\nG91\\nG1 E-1 F1800\\nG1 Z0.3\\nG90\\nG1 X180 Y180 F3600\\nG91\\nG1 Z-0.3\\nG1 E1 F1800\\nG90\\n";r;"Move head to trigger keeping frame"
                   
                  Reply
                  xA59rhR8FF
                  •

                  fe60 has it correct, the Find command should be:
                   
                  (;TYPE:Top solid infill\n)(.*?)(;TYPE:|$)(?!Top solid infill) 
                   
                  And the replace command should be:
                   
                  ${1}M221 S98\n${2}M221 S95\n${3}
                   
                  In my case I wanted top solid infill to be 95% and then subsequently reset to 100% to match my settings in SuperSlicer, so my replace command was as follows (leaving M221 without parameter resets it.)
                   
                  ${1}M221 S95\n${2}M221\n${3}
                  Reply