Who/WP is/VBZ the/DT author/NN of/IN the/DT book/NN ,/,/*comma* "/"/*\ quote* The/DT Iron/NNP Lady/NNP :/: A/DT Biography/NNP of/IN \Margaret/NNP That\ cher/NNP "/"/*quote* ?/./*end-of-sentence* #### Who/WP is/VBZ the author/NP of/IN the book/NP ,/, The Iron Lady/NP :/: A Biography of Margaret That\ cher/NP "/"... #### if ($sentence =~ / () ([a-zA-Z0-9.-_]+)\/([A-Z]+) ([^ ]+) (<\/NP>) /) { $text="NounPhrase"; # to test the match to replace $result =~ s/$question/$text/; print "$result";};