Retired

Make ruby 'match' output similar to js 'match' return (retired)

Description:

Guys, help me.

I do not know how solve this puzzle. Need to write Ruby code with 'match' that works like s.match(/([?!])\1*/g) in JAVA SCRIPT.

Input string have 5 characters length, and contains only "!" and "?".

Use exactly match, not scan method, please.

Thank you

PS: inspired by https://www.codewars.com/users/myjinxin2015 kata.

Regular Expressions

Stats:

CreatedNov 29, 2017
Warriors Trained111
Total Skips26
Total Code Submissions144
Total Times Completed23
Ruby Completions23
Total Stars2
% of votes with a positive feedback rating63% of 12
Total "Very Satisfied" Votes5
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes2
Total Rank Assessments13
Average Assessed Rank
7 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • lbvf50mobile Avatar
  • Unihedron Avatar
Ad