How to make the non-whitespace selector more selective

ControlAltDel

I am trying to validate IDs for HTML 5, jQuery, and CSS

For HTML 5, it's pretty easy: basically just \S+. Yes, you do need one character, but in practice this is never an issue for me.

The problem is with jQuery. I need to weed out at least the apostrophe (') and quote (") characters, plus parenthesis '(' and ')'. When I try to use a jQuery selector like: #he(llo) it throws an Exception.

Right now I am validating my ids negatively in two steps. First, check for matches with '\s', then with the specific characters mentioned above.

I am just wondering if it is possible to do this in 1 regex - especially like "check for \S, plus..." ex. [\S\'\"\(\)]

kunz

wont something like this work

[^\s'"()]+

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?

How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?

jQuery one fires more than once if there are more than one elements in the $ selector, how to make it only fire once?

how to make selector in android studio

jQuery: How to make $(this) selector work?

CSS selector for empty or whitespace

How to add more Whitespace to the Main Panel in Shiny Dashboard?

How does a strong selector override an id selector? Isn't an id selector considered more specific?

How to make Excel print selective tabs using VBA?

Nested UNWIND - selective behaviour for non-lists. How is this possible?

Python - How to remove more than 1 whitespace

How make scrollable whitespace on start and end of recyclerView

How can I make my boxes more equal (whitespace & box-sizing problem with flexbox)

How to make parent selector interpolated in the middle of nested selector in sass/scss

Match words only starting with a certain letter and then having 5 or more non-whitespace characters

How to make the "-- more --" prompt more visible in irssi?

Removal of whitespace and text in brackets - make my working code more elegant

How to make more dices?

How to make an OR selector instead of an AND statment

How to make more than one if state non case sensitive

How To Make More Functional?

How to make images move into available whitespace

How to add whitespace and make a united looking in WebStorm?

How to make it more beautiful?

How to make custom javascript selector?

How do I use a more generic selector?

How to make selective entire column absolute number

How to capture a sentence but ignore whitespace more than 1 with regex?

How to take selective backup?