Reputation: 3225
I want to replace all the :
xmlns="http://xml.blablabla"
and
xmlns:something="xxxx"
for a white space from a string.
Thanks
Upvotes: 0
Views: 1002
Reputation: 56162
Use this regex: xmlns="[^"]*"
, it matches xmlns="http://xml.blablabla"
, then replace match with empty string.
Upvotes: 0
Reputation: 6030
String#sub is your friend:
my_string = '<Fare_MasterPricerCalendarReply xmlns="http://xml.blablabla">'
my_string.sub(/\s.+$/, " >")
# => "<Fare_MasterPricerCalendarReply >"
Upvotes: 1