Skip to content

Instantly share code, notes, and snippets.

@Patrikgrinsvall
Last active January 26, 2022 16:37
Show Gist options
  • Save Patrikgrinsvall/648592bca89216056c501bcae8f440af to your computer and use it in GitHub Desktop.
Save Patrikgrinsvall/648592bca89216056c501bcae8f440af to your computer and use it in GitHub Desktop.
Regexp search replace patterns

Regexp search replace patterns

In this case using vs code

Simple example, from print "text" To print ("text")

print(.*?)\n

print ($1)

Regexp pattern

Advanced example

\/**\n *\n * $1\n *\t$2\n\ *\n *\n*\/\nfunction $1(\$description = "$2", ...\$args) {\n\tif(\$_ENV['DISABLE_PCNTL_PLUGIN']) return null\;\n\terror_log("['PCNTL_PLUGIN'] Ran, $1");\n}\n
  • the above will produce an output like this image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment