Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #4041
| From | Curtis Dyer <dyer85@gmail.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: regex help |
| Date | 2011-12-10 04:25 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <jbumvq$3cr$1@dont-email.me> (permalink) |
| References | <jbs0l0$7nj$1@dont-email.me> |
Jerry Stuckle <jstucklex@attglobal.net> wrote:
> OK, guys, I'll be the first to admit my regex knowledge is more
> than limited. And I've never used ereg().
My experience with POSIX regexes is also quite limited, but have you
tried Google'ing for comparisons between PCRE (PHP's preg_*
functions are built on top of PCRE) and POSIX regexes?
A quick search turned up: <http://www.regular-
expressions.info/refflavors.html>, which happens to be a helpful
regex site I've used in the past.
> So, I need to convert the following ereg() call in some code I'm
> modifying to a preg() call. Can someone please tell me what the
> ereg() does and the equivalent preg()?
>
> if (ereg("(error</b>:)(.+)(<br)", $buffer, $regs))
With regard to this specific piece of code, I can't see any obvious
differences in the way this regex pattern behaves in PCRE and POSIX.
For differences in how each function behaves differently, simply
consult the PHP documentation (which also contains a section
explaining PCRE regex syntax).
> TIA.
For a more comprehensive understanding of the two flavors, I would
settle for nothing less than reading the PCRE manual and the POSIX
standard regarding its implementation of regexes.
--
Curtis Dyer
<?$x='<?$x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
regex help Jerry Stuckle <jstucklex@attglobal.net> - 2011-12-08 22:51 -0500
Re: regex help Denis McMahon <denismfmcmahon@gmail.com> - 2011-12-09 11:55 +0000
Re: regex help Jerry Stuckle <jstucklex@attglobal.net> - 2011-12-09 07:32 -0500
Re: regex help Jerry Stuckle <jstucklex@attglobal.net> - 2011-12-09 07:51 -0500
Re: regex help Kim André Akerø <kimandre@nospambetadome.com> - 2011-12-09 14:16 +0100
Re: regex help Jerry Stuckle <jstucklex@attglobal.net> - 2011-12-09 21:51 -0500
Re: regex help Curtis Dyer <dyer85@gmail.com> - 2011-12-10 04:25 +0000
Re: regex help Denis McMahon <denismfmcmahon@gmail.com> - 2011-12-10 10:01 +0000
csiph-web