newbie at regular expressions needs help

This is a discussion on newbie at regular expressions needs help within the PHP General forums, part of the PHP Programming Forums category; OK, I am reading over some regular expressions tutorials and came across this: /th[^s]*./ -- I want to match the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-10-2004
Jimmy Jim
 
Posts: n/a
Default newbie at regular expressions needs help

OK, I am reading over some regular expressions tutorials and came
across this:

/th[^s]*./

-- I want to match the words that start
-- with 'th' and end with 's'.

-->this<--
-->thus<--
-->thistle<--
-->this<-- line matches too much

Why does the above not match any word starting with "th", any number
of letters that are NOT "s", and ending in ANY character (the period
symbolizes wildcard)??

This is supposed to be any word that begins in "th", and ends in "s".
Can someone help shed some light on this? Thank you very much,

JJ
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0