In Qgis Replace a '+' with a ', ' for labels

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using



regexp_replace("zone_nr", '+', ', ')


but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.










share|improve this question

















  • 1




    Have you tried replace("zone_nr", '+', ', ')?
    – Taras
    6 mins ago














up vote
1
down vote

favorite












I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using



regexp_replace("zone_nr", '+', ', ')


but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.










share|improve this question

















  • 1




    Have you tried replace("zone_nr", '+', ', ')?
    – Taras
    6 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using



regexp_replace("zone_nr", '+', ', ')


but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.










share|improve this question













I want to replace a '+' with ', ' to label an attribute looking like "ZT10+ZT20+ZT30" to get "ZT10, ZT20, ZT30" using



regexp_replace("zone_nr", '+', ', ')


but I get an Eval Error: Invalid regular expression '+': quantifier does not follow a repeatable item.







qgis replace






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 16 mins ago









Lukschn

364




364







  • 1




    Have you tried replace("zone_nr", '+', ', ')?
    – Taras
    6 mins ago












  • 1




    Have you tried replace("zone_nr", '+', ', ')?
    – Taras
    6 mins ago







1




1




Have you tried replace("zone_nr", '+', ', ')?
– Taras
6 mins ago




Have you tried replace("zone_nr", '+', ', ')?
– Taras
6 mins ago










3 Answers
3






active

oldest

votes

















up vote
3
down vote













A + is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a in front of it. So you need:



regexp_replace("zone_nr", '+', ', ')





share|improve this answer



























    up vote
    2
    down vote













    Or, simply use



    replace("zone_nr", '+', ', ')


    as this doesn't expect a regexp term (it simply matches all occurences of the specified input string).





    share



























      up vote
      1
      down vote













      You can input regular expression to find any single + like .+



      regexp_replace("zone_nr", '.+', ', ')




      share




















        Your Answer







        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "79"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f299672%2fin-qgis-replace-a-with-a-for-labels%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        3
        down vote













        A + is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a in front of it. So you need:



        regexp_replace("zone_nr", '+', ', ')





        share|improve this answer
























          up vote
          3
          down vote













          A + is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a in front of it. So you need:



          regexp_replace("zone_nr", '+', ', ')





          share|improve this answer






















            up vote
            3
            down vote










            up vote
            3
            down vote









            A + is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a in front of it. So you need:



            regexp_replace("zone_nr", '+', ', ')





            share|improve this answer












            A + is a special symbol to the QGis regular expression engine (it means 1 or more of the preceding character), so you need to escape it by putting a in front of it. So you need:



            regexp_replace("zone_nr", '+', ', ')






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 10 mins ago









            Ian Turton♦

            45.6k544106




            45.6k544106






















                up vote
                2
                down vote













                Or, simply use



                replace("zone_nr", '+', ', ')


                as this doesn't expect a regexp term (it simply matches all occurences of the specified input string).





                share
























                  up vote
                  2
                  down vote













                  Or, simply use



                  replace("zone_nr", '+', ', ')


                  as this doesn't expect a regexp term (it simply matches all occurences of the specified input string).





                  share






















                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    Or, simply use



                    replace("zone_nr", '+', ', ')


                    as this doesn't expect a regexp term (it simply matches all occurences of the specified input string).





                    share












                    Or, simply use



                    replace("zone_nr", '+', ', ')


                    as this doesn't expect a regexp term (it simply matches all occurences of the specified input string).






                    share











                    share


                    share










                    answered 6 mins ago









                    ThingumaBob

                    4,9581222




                    4,9581222




















                        up vote
                        1
                        down vote













                        You can input regular expression to find any single + like .+



                        regexp_replace("zone_nr", '.+', ', ')




                        share
























                          up vote
                          1
                          down vote













                          You can input regular expression to find any single + like .+



                          regexp_replace("zone_nr", '.+', ', ')




                          share






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            You can input regular expression to find any single + like .+



                            regexp_replace("zone_nr", '.+', ', ')




                            share












                            You can input regular expression to find any single + like .+



                            regexp_replace("zone_nr", '.+', ', ')





                            share











                            share


                            share










                            answered 1 min ago









                            Oto Kaláb

                            3,76431329




                            3,76431329



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f299672%2fin-qgis-replace-a-with-a-for-labels%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Comments

                                Popular posts from this blog

                                What does second last employer means? [closed]

                                List of Gilmore Girls characters

                                Confectionery