Hi Prakash,
Hard to code on the fly, isn't it?
Just to make it bug free, you still need to add a TRANSLATE lv_string to upper case before processing it... and change the LT symbol with a GT
(also sy-abcde not syabcde).
Personaly I'll go with regex! Although I like the ideas of Raymond & Stefan
Cheers,
Manu.