javascript - How to remove symbols from beginning and end of a string, except certain symbols? -


i using regex:

/^[^a-z\d]*|[^a-z\d]*$/gi 

this checks symbol in beginning , end of string.

however, want exclude these 4 symbols being removed:

( ) [ ] 

how can modify regex doesn't remove symbols?

then can add them excludes list:

/^[^\(\[\)\]a-z\d]*|[^\(\[\)\]a-z\d]*$/gi 

(if understand correctly , want remove symbols first occurence of 1 of these symbols - if not, not single regex, think)


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -