SPUG: more regx stuff
Gary Varnell
gary at 2dgs.com
Wed Sep 22 19:46:03 CDT 1999
Hello fellow SPUGers
After last nights meeting I decided to do some regx test.
I have to admit I had a hard time predicting the results.
If any one would like the source code that produced the following let me
know.
It is pretty basic stuff!
Here are two regx test on a list of space seperated names:
tom jones mike smith carl nelson dan strange merylin james
The first two examples assign the results to an array
Remeber, since we are assigning to an array 0 = 1 or the first position
in array
Here is the # of matches found using /(S+)/g
---------------------------------------------
9
---------------------------------------------
Here is the # of matches found using /(S+)/
---------------------------------------------
0
---------------------------------------------
Same as above with results assigned to a scaler variable
Here is the # of matches found using /(S+)/g
---------------------------------------------
1
---------------------------------------------
Here is the # of matches found using /(S+)/
---------------------------------------------
1
---------------------------------------------
Supprised?
Gary Varnell
--
__________________________________________________________
Digital Graphics Studios (DGS)
----------------------------------------------------------
Website: http://www.2dgs.com Phone: (360) 491-1149
E-mail: mailto:Info at 2dgs.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/spug-list/attachments/19990922/fff00ea9/attachment.htm
More information about the spug-list
mailing list