function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

REGEX expression for Starting and Trailing spaces


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}[ ]?

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