[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Demilter without string tokenizer

Posted on 2006-11-01
4
Medium Priority
?
274 Views
Last Modified: 2010-03-05
Hi

I am looking for sample code that will file spaces and get the words in the sentance.
Problem is I cannot use string tokenizer.

example: " THIS IS THE STRING"
$word1 = THIS
$word2 = IS
$word3 = THE
...

It is very urgent. It would be great if you can get me sample code...

Thanks
0
Comment
Question by:basirana
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
Perl_Diver earned 2000 total points
ID: 17851408
This might be too blunt but your example string shows only words seperated by spaces

my $string = 'THIS IS THE STRING';
my @words = $string =~ /(\S+)/g;
print "$_\n" for @words;
0
 
LVL 8

Expert Comment

by:Perl_Diver
ID: 17851416
Please explain what's the urgency? Are you sitting in class taking a test?
0
 
LVL 85

Expert Comment

by:ozo
ID: 17851618

($word1,$word2,$word3)=split for " THIS IS THE STRING"
0
 
LVL 8

Expert Comment

by:Perl_Diver
ID: 17859244
I guess it was really urgent......
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question