ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

SciTE regex replacement

<< < (2/2)

Edvard:
(yep, it's annoying that not everybody follows the same syntaxes).
--- End quote ---

Yep, in Textpad 5, you use the '&' symbol to spit out what you matched, so you would replace like so:

Find:      ^[a-Z]
Replace: _&

:shrug:

MilesAhead:
The main thing messing me up was putting the start of line symbol inside the pattern. I found PsPad makes it a bit easier than SciTE. This works in PsPad

find
^([a-zA-Z])

replace
_$1

and


--- ---func(param)
{
  jive()
}

func2(param2)
{
  jive2()
}

is magically transformed into


--- ---_func(param)
{
  jive()
}

_func2(param2)
{
  jive2()
}

It's a lot less confusing without the backslashes.

Navigation

[0] Message Index

[*] Previous page

Go to full version