Reputation: 1206
I want a regex in perl that can strip the word in capitals from the given sentence "Device from XML database". I can say that the whole sentence can change in future including the spaces present now. Only the "xml" word is fixed and all the stuff around it is volatile. So i want a strong regex that can withstand any changes in number of spaces and words before/after "xml" word.
Upvotes: 0
Views: 1156
Reputation: 5707
$string = "Device from XML database"; $string =~ s/\bXML\b\s//;
That'll grab one space after XML as well..
Upvotes: 2