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 -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -