Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

# Regex

joshua antony
Ranch Hand
Posts: 117

The output is

start: 1 group: 1+
start: 4 group: 3-
start: 7 group: 5=
start: 9 group: 45
start: 11 group: 45

I am not able to understand the last 2 lines of the output.
How come start: 9 group: 45
start: 11 group: 45 gets printed.

In this case we are searching for the first letter to be either 1,2,3,4 or 5 and the second one to be either _,- or =. isint it?

William Yan
Ranch Hand
Posts: 69
'+' is quantifier.
Maybe '-' is also quantifier too.
so

work.

Yours,
William

Henry Wong
author
Marshal
Posts: 21743
85
In this case we are searching for the first letter to be either 1,2,3,4 or 5 and the second one to be either _,- or =. isint it?

Interesting mistake... I probably would have made it myself.

It's the "-". It has special meaning used to specify a range, such as [a-z]. In this case, [+-=] means the range from the "+" to "=", which in the unicode table, includes the numbers.

Henry