PERL point? =^..^=

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

PERL point? =^..^=

Post by Mariasole » Tue Apr 12, 2016 4:57 pm

Hi!
I have another stupid question.

I have a list:

bla. bla bla bla?
bla. bla bla!
bla. bla bla bla bla.
bla. bla bla bla@
bla bla bla bla.
bla bla bla?
bla bla bla!

I would get this result:

bla. bla bla bla?
bla. bla bla!
bla. bla bla bla bla. ----> delete this!
bla. bla bla bla@
bla bla bla bla. ----> delete this!
bla bla bla?
bla bla bla!


How do I delete all the lines that end with a point with regex?

I tried this solution but it does not work! :oops:

filter lines of field "List" without regex pattern "(?:^\.)"

Thanks for your help!

Mariasole
=^..^=
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: PERL point? =^..^=

Post by Thierry » Tue Apr 12, 2016 5:03 pm

what about this one ?

Code: Select all


"\.$"
Regards,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: PERL point? =^..^=

Post by FourthWorld » Tue Apr 12, 2016 6:08 pm

Another option:

Code: Select all

  filter tMyList without "*."
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

Re: PERL point? =^..^=

Post by Mariasole » Tue Apr 12, 2016 6:51 pm

FourthWorld wrote:Another option:

Code: Select all

  filter tMyList without "*."
Wow! It works! Thanks Richard!
And how I can do, if I can abuse your patience, the exact opposite?
That is, remove from the list the phrases that have NOT the point at end, with regex?

original list:

bla bla. bla bla bla!
bla bla bla bla bla.
bla bla. bla bla bla
bla. bla bla bla.
bla bla. bla bla bla



what I would

bla bla. bla bla bla! ----> delete this!
bla bla bla bla bla.
bla bla. bla bla bla ----> delete this!
bla. bla bla bla.
bla bla bla. bla ----> delete this!
bla bla. bla bla bla? ----> delete this!

thank you very much!

Mariasole
=^..^=
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator

Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

Re: PERL point? =^..^=

Post by Mariasole » Tue Apr 12, 2016 6:56 pm

Thierry wrote:what about this one ?

Code: Select all


"\.$"
Regards,

Thierry
I am ashamed a bit but I meant in PERL: "hey, removes the lines that end with a point!" :D
But probably I said "lasjf Vlah f jdf jslgj sjghsdjkf!" :oops:

Mariasole
=^..^=
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: PERL point? =^..^=

Post by Thierry » Tue Apr 12, 2016 7:09 pm

Mariasole wrote: I am ashamed a bit but I meant in PERL: "hey, removes the lines that end with a point!" :D
Mariasole
=^..^=
:roll:

Code: Select all

put fld "xxxx" into T
filter T without regex pattern "\.$"
should work! or what did I miss?

for the opposite, just do:

Code: Select all

filter T with regex pattern "\.$"
or

Code: Select all

filter T without regex pattern "[^.]$"
or use the wildcards :D

so many ways....

Best,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Mariasole
Posts: 235
Joined: Tue May 07, 2013 9:38 pm

Re: PERL point? =^..^=

Post by Mariasole » Tue Apr 19, 2016 6:17 pm

Thanks Thierry,
sorry for the delay but I had the flu! :?
everything works, you are very kind! :P
I would like to ask you something. There is a web page where I can find the basics of regex art? :?:
A page for hard heads like me? :oops: A regex page compatible with LC? :roll:
Thank you

Mariasole
=^..^=
"I'm back" - The Cyberdyne Systems Model 101 Series 800 Terminator

Post Reply