+ 2
Write a regex that matches 'ab' if a and b are both numbers and their sum equals 10.
How do we write the above regex? Edit: examples: Matches: 55, 73, 91 Doesn't match: six4, a234, 145, 2a8, 2.08.0, 010
6 Antworten
+ 3
Just in case anyone is reading this in the future. I found a simple way to cheat.
https://code.sololearn.com/ca8r7j5hkX4A/?ref=app
+ 1
Can you please provide example?
+ 1
doubt this can be done as regex can't really do things such as add numbers
+ 1
This task is better done by dividing it in two parts: first extract all digit pairs and second, filter those that add up to 10.
0
𝕾𝖆𝖌𝖆𝕿𝖍𝖊𝕲𝖗𝖊𝖆𝖙 💯 done!
0
hinanawi ok....... Thank you!
That's a great idea Kuba Siekierzyński! filter() KA-CHHING! Why didn't I think of that? Thank you!