Re: A quick Regex query
| From: | M. Sokolewicz | Date: | Thu, 16 Feb 2006 22:59:21 +0000 |
| Subject: | Re: A quick Regex query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230605@lists.php.net to get a copy of this message | ||
hi, have you tried
[^0-9][0-9]{4} [A-Za-zÅØ]{2,20}
?
- tul
phplists wrote:
Hi, I am using the following: [0-9]{4} [A-Za-zÅØ]{2,20} to extract data like: 1000 Øslo How can I alter the above to limit to ONLY 4 digits, or in other words exclude: 11000 Beograd Please note that what I am extracting from is NOT at the begining of a line, so I can't use the ^ first. Also, you may notice a couple of 'special' characters in my expression 'Å + Ø' By putting them in they seem to work fine, but is this the best way of doing it? MTIA Alexis