Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 14:05 < c-c> I'm playing with some CSS class names... So at first I wanted to have selectors name with function context prefix and then the module name..
- ".header-acmemodule-h1-black". Ok that was silly, of course the module name should be first: ".acmemodule-header-h1-black". So substitute first
- word after dot to first word after '-' and the first word after first '-' after the dot.
- 14:05 < c-c> So start of it would be %s/^\.
- 14:07 < c-c> How to write a substitute regex that swaps the words on both sides of first '-'? after '^\.'
- 14:08 < osse> :s/^\.\([^-]*\)-\([^-]*\)/.\2-\1/
- 14:13 < c-c> Ok so thats matching a startofline and . followed by "a pattern" with "a collection" that "doesn't start with - and has any character" "until next
- -", and substitutes "2"nd match first, a - and "1"st match second ?
- 14:19 < c-c> osse: substituting "acmemodule" for the latter [^-]* - that looks like it worked flawless
Add Comment
Please, Sign In to add comment