replace beetween two strings

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

replace beetween two strings

PICCORO McKAY Lenz
i'v this cae,

in a line i have:

" string pepe pablo, data toto made thinker data2 \" and also a pizza"

i what to remove all the string or extrac all the string beetween the
"data" fist ocurrence and the next after that ocurrence..

i try to do but in the for each always replace twice..


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: replace beetween two strings

Fernando Cabral
2017-07-28 13:11 GMT-03:00 PICCORO McKAY Lenz <[hidden email]>:

>
> " string pepe pablo, data toto made thinker data2 \" and also a pizza"
>
> i what to remove all the string or extrac all the string beetween the
> "data" fist ocurrence and the next after that ocurrence..
>

".*?data (.*?) data2" saves the substring between "data" and "data2" to the
first buffer.

You can recover it with &1 (\1 in more traditional regex replace).

- fernando

>
> i try to do but in the for each always replace twice..
>
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



--
Fernando Cabral
Blogue: http://fernandocabral.org
Twitter: http://twitter.com/fjcabral
e-mail: [hidden email]
Facebook: [hidden email]
Telegram: +55 (37) 99988-8868
Wickr ID: fernandocabral
WhatsApp: +55 (37) 99988-8868
Skype:  fernandojosecabral
Telefone fixo: +55 (37) 3521-2183
Telefone celular: +55 (37) 99988-8868

Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
nenhum político ou cientista poderá se gabar de nada.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: replace beetween two strings

PICCORO McKAY Lenz
RegExp.Replace are since 3.5, but thanks for the sugestion fernando, the
idea are usefully due i'll emulate the pattern with shell commands

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-07-28 13:43 GMT-04:00 Fernando Cabral <[hidden email]>:

> 2017-07-28 13:11 GMT-03:00 PICCORO McKAY Lenz <[hidden email]>:
>
> >
> > " string pepe pablo, data toto made thinker data2 \" and also a pizza"
> >
> > i what to remove all the string or extrac all the string beetween the
> > "data" fist ocurrence and the next after that ocurrence..
> >
>
> ".*?data (.*?) data2" saves the substring between "data" and "data2" to the
> first buffer.
>
> You can recover it with &1 (\1 in more traditional regex replace).
>
> - fernando
>
> >
> > i try to do but in the for each always replace twice..
> >
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
>
>
> --
> Fernando Cabral
> Blogue: http://fernandocabral.org
> Twitter: http://twitter.com/fjcabral
> e-mail: [hidden email]
> Facebook: [hidden email]
> Telegram: +55 (37) 99988-8868
> Wickr ID: fernandocabral
> WhatsApp: +55 (37) 99988-8868
> Skype:  fernandojosecabral
> Telefone fixo: +55 (37) 3521-2183
> Telefone celular: +55 (37) 99988-8868
>
> Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
> nenhum político ou cientista poderá se gabar de nada.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...