0

I have some CSS code in my document include left and right words.

I need to replace right => left and left => right.

Is possible in PhpStorm or Notepad++ to replace these words simultaneous ?

LazyOne
  • 158,824
  • 45
  • 388
  • 391

1 Answers1

2

Using Notepad++

  • Ctrl+H
  • Find what: (right)|(left)
  • Replace with: (?1left:right)
  • check Wrap around
  • check Regular expression
  • Replace all

Explanation:

(right)     # group 1
|           # OR
(left)      # group 2

Replacement:

(?1         # if group 1 exists
    left    # replace with left
    :       # else
    right   # replace with right
)

Screen capture (before):

enter image description here

Screen capture (after):

enter image description here

Toto
  • 89,455
  • 62
  • 89
  • 125