On Tuesday 16 March 2004 01:06, Ryan A wrote: > I know this is pretty easy to do but I am horrorable at working with > regular expressions and was wondering if anybody might take a min to help > please. > > I will have a variable: $the_extention > which will have a value like: 98797-234234--2c-something-2c > > How do I take out the part which will always start with "--2c" and will > always end with "-2c"
For something as simple and predictable as that using regex seems to be an overkill. The simple string functions ought to be adequate. explode() might be all you need. > eg: > Using the above variable I want to do something like > $second_extention= use_regex_here($the_extention) > > (value of $second_extention becomes: 98797-234234) > > A good "baby steps" tutorial on regex too would be appreciated. google -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* When I left you, I was but the pupil. Now, I am the master. - Darth Vader */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php