Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for rfar_php.bat

(view source code of rfar_php.bat as plain text)

  1. :: https://www.robvanderwoude.com/batchphp.php
  2. :: %1=regex pattern
  3. :: %2=replacement (use \\n or $n or ${n} for back references, where n is an integer)
  4. :: %3=subject string
  5. :: e.g. RFAR /./ "A" "Test string" returns "AAAAAAAAAAA"
  6. :: e.g. RFAR "/img(_?)(\d{4,5})\.cr2/i" "Foto${2}.cr2" "IMG_8094.CR2" returns "Foto8094.cr2"
  7. :: e.g. RFAR /\d/ "9" "Phone number: 0123456789" returns "Phone number: 9999999999"
  8. @IF NOT "%~3"=="" PHP.EXE -r "print(preg_replace('%~1','%~2','%~3'));"

page last modified: 2024-04-16; loaded in 0.0045 seconds