# Use RegEx on Find/Replace IDE

**URL:** <https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047>\
**Category:** General\
**Created:** [May 2, 2022, 9:13pm UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047 "2022-05-02T21:13:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Cunha](https://forum.xojo.com/user_avatar/forum.xojo.com/alexandre_cunha/32/1221_2.png) [@Alexandre\_Cunha](https://forum.xojo.com/u/Alexandre_Cunha)\
**Post date:** [May 2, 2022, 9:13pm UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/1 "2022-05-02T21:13:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [May 3, 2022, 1:58am UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/2 "2022-05-03T01:58:24Z")

</div>

Search:

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

Replace:

`pop\1.SelectedRowValue`

---

<div class="post-metadata">

**Author:** ![Alexandre\_Cunha](https://forum.xojo.com/user_avatar/forum.xojo.com/alexandre_cunha/32/1221_2.png) [@Alexandre\_Cunha](https://forum.xojo.com/u/Alexandre_Cunha)\
**Post date:** [May 10, 2022, 9:32pm UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/3 "2022-05-10T21:32:19Z")

</div>

> [@Kem\_Tekinay](#):
>
> pop\1.SelectedRowValue

YEAH!!!

---

<div class="post-metadata">

**Author:** ![Alexandre\_Cunha](https://forum.xojo.com/user_avatar/forum.xojo.com/alexandre_cunha/32/1221_2.png) [@Alexandre\_Cunha](https://forum.xojo.com/u/Alexandre_Cunha)\
**Post date:** [May 10, 2022, 9:36pm UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/5 "2022-05-10T21:36:36Z")

</div>

@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)

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [May 10, 2022, 9:38pm UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/6 "2022-05-10T21:38:27Z")

</div>

I don’t think so.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Cunha](https://forum.xojo.com/user_avatar/forum.xojo.com/alexandre_cunha/32/1221_2.png) [@Alexandre\_Cunha](https://forum.xojo.com/u/Alexandre_Cunha)\
**Post date:** [May 11, 2022, 1:24am UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/7 "2022-05-11T01:24:43Z")

</div>

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

pop **Grupo**.Text= **value**

to this:

pop **Grupo**.SelectRowWithValue( **value** )

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

---

<div class="post-metadata">

**Author:** ![Alexandre\_Cunha](https://forum.xojo.com/user_avatar/forum.xojo.com/alexandre_cunha/32/1221_2.png) [@Alexandre\_Cunha](https://forum.xojo.com/u/Alexandre_Cunha)\
**Post date:** [May 11, 2022, 2:22am UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/8 "2022-05-11T02:22:35Z")

</div>

found!

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

😉

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [May 11, 2022, 2:57am UTC](https://forum.xojo.com/t/use-regex-on-find-replace-ide/70047/9 "2022-05-11T02:57:52Z")

</div>

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.
