ruby - Trying to change last to "x"s to 23 -
i have been playing around irb
, have string looks this:
irb(main):072:0> puts ["[\"4354 5432 5432 xxxxx\", \"6547 6547 8543 xxxxx\", \"2344 6543 6674 xxxxx\", \"2346 6236 7543 xxxxx\", \"1273 5585 5587 xxxxx\"]"] => nil irb(main):073:0>
what want gsub
last 2 "x"
s of each 17 digit combination, 23
.
what i've tried far (i've been using rubular):
a.gsub(/\d[x]/,"23")
<= grabs"x"
s i'm closea.gsub(/\w[x{2}]/,"23")
<= grabs"x"
s grabs two digits each combination.
is there easier way i'm not understanding?
a.gsub(/\d{4} \d{4} \d{4} xxx\kxx/, '23')
\d{4}
= 4 digits
what \k
drop matched far. can use don't replace entire number, still able validate have in desired format.
Finden Sie das perfekte Thema fรผr Ihre WordPress-Site. Wรคhlen Sie aus Tausenden atemberaubender wordpress themes deutsch.
ReplyDeleteWhat a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these, I have new and perfect site Slot. Thank you very much.
ReplyDeleteThis page contains the necessary information about game. From here I am get some information.Have
ReplyDeleteyou played the famous akinator unblocked
? If not, you must play it today only as it is a quite amazing game which will give you some fun moments playing it in your busy day schedule
This page contains the necessary information The Samsung Galaxy M52 is going to be published very soon if you feel free you can visit my site Samsung M52 Release Date
ReplyDeleteWhat a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these, I have new and perfect site buy lsd online. Thank you very much.
ReplyDeleteWhat a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these, I have new and perfect site asesoria inmobiliaria. Thank you very much.
ReplyDeleteWe are very satisfied with Shiftbase because all of our employees can easily see their schedule in the mobile app and they can specify their availability! Also, the customer service is very helpful and responds quickly to all our questions. ๐๐ schedule maker
ReplyDelete๐๐ You can quickly and easily make a schedule for your team in the main menu of the Shiftbase under ‘Schedule’. On the left side, you will see the names of the employees and at the top, you will see the dates.
I am continually amazed by the amount of information available on this subject.What you presented was well researched and well worded in order to get your stand on this across to all your readers lithium ion forklift battery charger.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete