|
RHOADSM1@WESTAT.COM sagely spoke:
>Did you know that:
>
>You need to be a little careful when using the \w ("word") character
>class in regular expressions.
>
>I just ran across an example in the SAS documentation using PRXPOSN to
>reverse first and last names. The regular expression uses \w to
>represent each name like so: /(\w+), (\w+)/
>
>However, "word" characters are defined as alphanumeric plus the
>underscore. Notably, they do not include hyphens or apostrophes.
>
>Thus, while the example works fine on the test data they supplied, it
>does not work correctly with names such as O'Reilly or Sekula-Gibbs.
>
>Mike Rhoads
>Westat
>RhoadsM1@Westat.com
This is one of the things I stress in my PRX function seminars. The
'word' character is a logical 'word' for, say, a SAS or Perl programmer,
not for a speaker of English.
HTCT,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
View Athlete’s Collections with Live Search
http://sportmaps.live.com/index.html?source=hmemailtaglinenov06&FORM=MGAC01
|