+ Start a Discussion
Abhi_TripathiAbhi_Tripathi 

REGEX expression for Starting and Trailing spaces

Hi,

I am having a regex expression for a perticular format. The format is working a I want, but now I want to add Starting and Trailing spaces with the expression. but didn't succeed, 

My regext expression is [a-zA-Z]{1}(\d){8}​

Any help would be appreciated.
Vamsi KrishnaVamsi Krishna
you can try using [ ]? at the begining & end of your current expression. [ ] indiactes a space and ? indicates may or may not occur. 

all together it might look like
​[ ]?[a-zA-Z]{1}[0-9]{8}[ ]?

 
Abhi_TripathiAbhi_Tripathi
Hi Vamsi,

Thanks for the reply , but it stopped working after using that you suggested, I don't want it start and trailing spaces optionally, its required

Thanks