Saturday, 1 November 2014

Range Of Characters

'-' is used to check for range of characters.

For Example
[a-f,A-F,0-9]{4}
Above regular expression is used to check for 32bit hexa decimal strings.

Run the harness program like below inputs.

Sample Output
Enter Regular Expression
[a-f,A-F,0-9]{4}
Enter the string
ABCD
I found the text ABCD starting at index 0 Ending at index 4

Enter the string
9aff
I found the text 9aff starting at index 0 Ending at index 4

Enter the string
10zd



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment