Guest User

Untitled

a guest
Jun 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. 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..
  2. ".header-acmemodule-h1-black". Ok that was silly, of course the module name should be first: ".acmemodule-header-h1-black". So substitute first
  3. word after dot to first word after '-' and the first word after first '-' after the dot.
  4. 14:05 < c-c> So start of it would be %s/^\.
  5. 14:07 < c-c> How to write a substitute regex that swaps the words on both sides of first '-'? after '^\.'
  6. 14:08 < osse> :s/^\.\([^-]*\)-\([^-]*\)/.\2-\1/
  7. 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
  8. -", and substitutes "2"nd match first, a - and "1"st match second ?
  9. 14:19 < c-c> osse: substituting "acmemodule" for the latter [^-]* - that looks like it worked flawless
Add Comment
Please, Sign In to add comment