Regular Expressions

May 4, 2011 at 11:02am

Regular Expressions

hey all,

You lot have been amazingly helpful and patient with all my noobish questions, but fraid i have one more. Im looking to use regular expressions to extract specific words from text within a message box.

Example:

extracting the word dog, from the sentence: [the dog is fat and lazy]

any guidance on this would be greatly appreciated

many thanks

Tom

#56849
May 4, 2011 at 11:04am

Thatsa simple: regexp

#203787
May 4, 2011 at 11:14am

sorry jvkrm, dont really understand your answer.

#203788
May 4, 2011 at 11:46am

There is a regexp object that does regular expressions.

#203789
May 4, 2011 at 11:48am

create a new object called [regexp].

then alt+click that object and read the help page.

#203790
May 4, 2011 at 12:38pm

Hi Teej,

I’m afraid I don’t understand what you mean by “extracting”… do you want to remove the word, in order to obtain “the is fat and lazy”? Or to know whether your message contains the word “dog”? In both cases, zl (filter / sub) is going to be much easier than regexp. But maybe I didn’t get your question…

cheers
aa

#203791

You must be logged in to reply to this topic.