Posts Tagged ‘phpdesigner’

Today I need to add suffix to my css codes. Unfortunately I’m too lazy to do this repeated task again and again. With PHPDesigner, I tried to automate this task and with a little knowledge of regular expression now the problem is solved.

A quick explanation of regex that I use:

^\.([a-zA-Z\-]*)
- ^\. search for string start with .
- (…) capture the content inside with scope
- [a-zA-Z\-] only contain a-z, A-Z, and -
- * repeat the search condition [a-zA-Z\-] for next characters

\.$1_red
- \. write .
- $1 write matched string in the scope
- _red write _red

Find and replace regular expression