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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |