php - regex for css class and id -


i want insert class , id of css file in database rows,

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;} article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;} ol,ul{list-style:none;margin:0;padding:0;} .subscribe p{ .txt-rt{text-align:right;} .pos-relative{position:relative;} 

from subscribe p want subscribe not p looking regex filter elements between . , { or space each class:

.txt-rt{text-align:right;} 

i have search between . , { , for

.subscribe p{ 

i have search between . , space

this regex should able find classes , ids in stylesheet.

[.#]([\w.-]+) 

demo: https://regex101.com/r/xb0dz6/1

it pretty says string must start # or . contain @ least 1 alphanumerical character, ., -, or _.

you may want add starting anchor or trailing check, .*?{. with

marque {      width: 2.2px } 

the .2px match rule.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -