Which part of the string abl230cde will be matched by the re

Which part of the string: abl230cde will be matched by the regex described below? C[a - z]?)([0 - 9]+)([a - z]+) 1230cde Nothing b1230cde ab1230cde

Solution

ab1230cde , whole string would be matched by the given regular expression:

because in starting it says any alphabet from a to z hence it matches a, then ? in that says anything could be there hence matches b..ab

now it says 0-9 that means any number from 0-9 + simple after that says anything after that hence a-z alphabtes will fit in

 Which part of the string: abl230cde will be matched by the regex described below? C[a - z]?)([0 - 9]+)([a - z]+) 1230cde Nothing b1230cde ab1230cde Solutionab1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site