How replace * character with what it's found











up vote
0
down vote

favorite












I can't find specifically what I'm looking for, possibly because it's not possible. Essentially, I want to find capitalised words and replace them with the capitalised word followed by a carriage break.



I was thinking something along the lines of ([A-Z])*([A-Z]) = /1/2/3^p, but I get an error message saying there's a number out of range and any other way I've tried ends up basically replacing with only the first and last letter intact.



Is there any hope?










share|improve this question
























  • You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
    – AFH
    Nov 21 at 20:00















up vote
0
down vote

favorite












I can't find specifically what I'm looking for, possibly because it's not possible. Essentially, I want to find capitalised words and replace them with the capitalised word followed by a carriage break.



I was thinking something along the lines of ([A-Z])*([A-Z]) = /1/2/3^p, but I get an error message saying there's a number out of range and any other way I've tried ends up basically replacing with only the first and last letter intact.



Is there any hope?










share|improve this question
























  • You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
    – AFH
    Nov 21 at 20:00













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I can't find specifically what I'm looking for, possibly because it's not possible. Essentially, I want to find capitalised words and replace them with the capitalised word followed by a carriage break.



I was thinking something along the lines of ([A-Z])*([A-Z]) = /1/2/3^p, but I get an error message saying there's a number out of range and any other way I've tried ends up basically replacing with only the first and last letter intact.



Is there any hope?










share|improve this question















I can't find specifically what I'm looking for, possibly because it's not possible. Essentially, I want to find capitalised words and replace them with the capitalised word followed by a carriage break.



I was thinking something along the lines of ([A-Z])*([A-Z]) = /1/2/3^p, but I get an error message saying there's a number out of range and any other way I've tried ends up basically replacing with only the first and last letter intact.



Is there any hope?







microsoft-word find-and-replace






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 19:38









Toto

3,32191125




3,32191125










asked Nov 21 at 19:26









Francesca Elena Pieri

1




1












  • You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
    – AFH
    Nov 21 at 20:00


















  • You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
    – AFH
    Nov 21 at 20:00
















You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
– AFH
Nov 21 at 20:00




You have tagged only two fields, with (...), so 3 is out of range. I haven't time to check, but, assuming that Word handles the full range of regular expressions, then all you need is ([A-Z]*[A-Z]) -> 1^p, where 1 refers to the whole of the string matched. Greedy matching makes sure that the whole word is matched, though a string like ABC123DEF will be replaced as you may or may not wish.
– AFH
Nov 21 at 20:00










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You are getting the error because you have only 2-sets of parentheses marking logical strings in your Find statement ([A-Z])*([A-Z]) and in your Replace statement /1/2/3^p you are saying there are three sets.



If you want to leave your Replace statement as is, then change the Find statement to ([A-Z])(*)([A-Z]). Although, you might not really be happy with the results it returns, but try it and see if that's what you want. It is going to return multiple words due to the inclusion of the * wildcard.



A better Find statement for locating all capitalized words is: <([A-Z]{2,10})>
The left and right arrow wildcards direct the find to locate only words that start with the included criteria. The control field with curly brackets tell the Find that there must be at a minimum 2 characters and a maximum of 10 (I just randomly picked 10 as the max, you can set it to anything) of the preceding criteria. Using this wildcard Find statement, the Replace statement should be /1^p.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377395%2fhow-replace-character-with-what-its-found%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You are getting the error because you have only 2-sets of parentheses marking logical strings in your Find statement ([A-Z])*([A-Z]) and in your Replace statement /1/2/3^p you are saying there are three sets.



    If you want to leave your Replace statement as is, then change the Find statement to ([A-Z])(*)([A-Z]). Although, you might not really be happy with the results it returns, but try it and see if that's what you want. It is going to return multiple words due to the inclusion of the * wildcard.



    A better Find statement for locating all capitalized words is: <([A-Z]{2,10})>
    The left and right arrow wildcards direct the find to locate only words that start with the included criteria. The control field with curly brackets tell the Find that there must be at a minimum 2 characters and a maximum of 10 (I just randomly picked 10 as the max, you can set it to anything) of the preceding criteria. Using this wildcard Find statement, the Replace statement should be /1^p.






    share|improve this answer

























      up vote
      0
      down vote













      You are getting the error because you have only 2-sets of parentheses marking logical strings in your Find statement ([A-Z])*([A-Z]) and in your Replace statement /1/2/3^p you are saying there are three sets.



      If you want to leave your Replace statement as is, then change the Find statement to ([A-Z])(*)([A-Z]). Although, you might not really be happy with the results it returns, but try it and see if that's what you want. It is going to return multiple words due to the inclusion of the * wildcard.



      A better Find statement for locating all capitalized words is: <([A-Z]{2,10})>
      The left and right arrow wildcards direct the find to locate only words that start with the included criteria. The control field with curly brackets tell the Find that there must be at a minimum 2 characters and a maximum of 10 (I just randomly picked 10 as the max, you can set it to anything) of the preceding criteria. Using this wildcard Find statement, the Replace statement should be /1^p.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        You are getting the error because you have only 2-sets of parentheses marking logical strings in your Find statement ([A-Z])*([A-Z]) and in your Replace statement /1/2/3^p you are saying there are three sets.



        If you want to leave your Replace statement as is, then change the Find statement to ([A-Z])(*)([A-Z]). Although, you might not really be happy with the results it returns, but try it and see if that's what you want. It is going to return multiple words due to the inclusion of the * wildcard.



        A better Find statement for locating all capitalized words is: <([A-Z]{2,10})>
        The left and right arrow wildcards direct the find to locate only words that start with the included criteria. The control field with curly brackets tell the Find that there must be at a minimum 2 characters and a maximum of 10 (I just randomly picked 10 as the max, you can set it to anything) of the preceding criteria. Using this wildcard Find statement, the Replace statement should be /1^p.






        share|improve this answer












        You are getting the error because you have only 2-sets of parentheses marking logical strings in your Find statement ([A-Z])*([A-Z]) and in your Replace statement /1/2/3^p you are saying there are three sets.



        If you want to leave your Replace statement as is, then change the Find statement to ([A-Z])(*)([A-Z]). Although, you might not really be happy with the results it returns, but try it and see if that's what you want. It is going to return multiple words due to the inclusion of the * wildcard.



        A better Find statement for locating all capitalized words is: <([A-Z]{2,10})>
        The left and right arrow wildcards direct the find to locate only words that start with the included criteria. The control field with curly brackets tell the Find that there must be at a minimum 2 characters and a maximum of 10 (I just randomly picked 10 as the max, you can set it to anything) of the preceding criteria. Using this wildcard Find statement, the Replace statement should be /1^p.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 11:50









        Rich Michaels

        1,0842210




        1,0842210






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377395%2fhow-replace-character-with-what-its-found%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            QoS: MAC-Priority for clients behind a repeater

            Ивакино (Тотемский район)

            Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)