Saturday 1 November 2014

Match any digit with \d

\d match a digit 0-9.

for Example \d+ match any number of digits

Sample Output
Enter Regular Expression
\d+
Enter the string
0
I found the text 0 starting at index 0 Ending at index 1

Enter the string
12
I found the text 12 starting at index 0 Ending at index 2

Enter the string
123
I found the text 123 starting at index 0 Ending at index 3

Enter the string
Hello 123
I found the text 123 starting at index 6 Ending at index 9

Enter the string
Hello 123 456
I found the text 123 starting at index 6 Ending at index 9
I found the text 456 starting at index 10 Ending at index 13


Note
Use this program to run above sample




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment