Recently i read the source of qt creator. However I found a lot of doubtable codes. Have look at the codes below:
Qt Code:
  1. defineReplace(cleanPath) {
  2. win32:1 ~= s|\\\\|/|g
  3. contains(1, ^/.*):pfx = /
  4. else:pfx =
  5. segs = $$split(1, /)
  6. out =
  7. for(seg, segs) {
  8. equals(seg, ..):out = $$member(out, 0, -2)
  9. else:!equals(seg, .):out += $$seg
  10. }
  11. return($$join(out, /, $$pfx))
  12. }
To copy to clipboard, switch view to plain text mode 
What do the four backslashs mean? and also the '|g', '^' ? I can't find anything useful in the document.