|
#1
|
|||
|
|||
|
I'm trying to match CSS selectors (not including the curly brackets {}).
Here are a couple attempts thus far though unsuccessfully... PHP Code:
PHP Code:
Code:
body h1 h1, h2, h3, h4 div div.border a:hover a:link a:focus |
|
#2
|
|||
|
|||
|
try this:
PHP Code:
__________________
[Jasme Library (Javascript Motion Effects)] My Site /\/\@§†ê® §©®¡þ† /\/\@|{ê® There are 10 kinds of people in the world, those that understand binary and those that don't. |
| The Following User Says Thank You to Master_script_maker For This Useful Post: | ||
JAB Creations (05-13-2008) | ||
|
#3
|
|||
|
|||
|
Cool thanks, that seems to work fine as far as I can tell.
![]() I forgot to also mention I'd like to match if the string is empty and I'm not seeing anything in regards to 'empty' on any of the reference sites.
|
|
#4
|
|||
|
|||
|
you would like to detect if something is empty? what do you mean exactly/do you have any examples of what you want?
__________________
[Jasme Library (Javascript Motion Effects)] My Site /\/\@§†ê® §©®¡þ† /\/\@|{ê® There are 10 kinds of people in the world, those that understand binary and those that don't. |
|
#5
|
|||
|
|||
|
Here is an example of what I mean by 'empty'...
<input value="" /> ...so I'd also like to match empty selectors. |
|
#6
|
|||
|
|||
|
to match an empty string you would use:
PHP Code:
PHP Code:
__________________
[Jasme Library (Javascript Motion Effects)] My Site /\/\@§†ê® §©®¡þ† /\/\@|{ê® There are 10 kinds of people in the world, those that understand binary and those that don't. |
|
#7
|
|||
|
|||
|
That didn't match? I've begun to grasp regex to some extent though the things I just tried made me realize there is plenty of logic I'm missing thus far.
Here is the full file I'm using to test regex filters that is making it very easy for me to test the regex filters out... PHP Code:
|
|
#8
|
|||
|
|||
|
Quote:
Code:
/^([0-9A-z]([#|.|,|:][0-9A-z]){0,10})?$/
/ starts the reg ex^([0-9A-z] stats the values must start with any lowercase / uppercase letter or a digit([#|.|,|:] states next must come either a number sign (id), a dot (class), comma (additional style), or a full colon (pseudo class)[0-9A-z]) stats the declaration of css style type must be followed by at any digit or lowercase/uppercase letter){0,10} stats this occurance of the value may exist anywhere in the inclusive range of 0 - 10 times. but not more)? stats this value may never exist to begin with$ stats this value must not contain any other charactersends the regular expression
__________________
This is a forum system not a PM system for questions. please treat it appropriately |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|