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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -