Use RegEx on Find/Replace IDE

Hi!

I need to create a find / replace regex to do this:
find: popExecutivoTratamento.text
replace: popExecutivoTratamento.SelectedRowValue

of cource, it’s not so simple…
find: popANYTHINGHERE.text
replace: popTHESAMETHINGHERE.SelectedRowValue

I wrote a pattern that show me a list of matches: pop\w+.text
but i don’t know how to use to replace ONLY the .text to .SelectedRowValue from found matched lines.

Any one can help? one simple example will be great! I’ll fix a thousand bugs from 2019 web project to 2022…

Thank you all!

Alex

Search:

\bpop(\w+)\.text\b

Replace:

pop\1.SelectedRowValue

3 Likes

YEAH!!!

1 Like

@Kem_Tekinay , is there a way to run a find/replace inside the XOJO 2022 IDE Script?

i.e.… after i open a project from 2018 version on 2022 IDE, i just run a script to change a lot of REGEX finds/replaces?
(those find/replaces already inside the script, of course)

I don’t think so.

With the same idea, how to find 2 values here?

popGrupo.Text=value

to this:

popGrupo.SelectRowWithValue(value)

is there a way to change the first and the second found values?
something like this:
pop\1.SelectedRowWithValue(\2)

found!

\bpop(\w+).text = \b(.*)

:wink:

You don’t need the second \b. But you should put a backslash before the first dot.

Also, put a * after each space around the equals sign.