On Wed, 2003-06-04 at 11:00, Michael Ryan Byrd wrote:
> > I'm looking to match a string every time it is not preceded or
> > followed by a letter.
>
> hmmm. Would this work?
>
> eregi_replace("[^a-z]*Booty[^a-z]*","_\\0_","your Booty String Here");
I don't know how php does regexps really, but the above seems to
basically jive with the perl regexp I would suggest (and these both
assume you know the string you want to match is exactly "Booty"):
s/([^a-zA-Z]*)Booty([^a-zA-Z]*)/\1NewBootyString\2/
or something like that. I heard php and perl were similar...hope this
helps.
Bryan
>
>
>
> > "Booty" as my example).
> >
> > For example, I would want to match:
> > Booty
> > Booty (with a space)
> > Booty,
> > Booty.
> > "Booty"
> >
> > etc., but not:
> >
> > Bootylicious
> >
> > When I find Booty, I want to do some formatting to Booty, but not to
> > the punctuation or space following or preceding.
> >
> > for example, change "Booty," to "_Booty_,"
> >
> > I'm doing this in a php environment. Can anyone help or point me in the
> > direction of a "dummies" tutorial?
> >
> > Thanks,
> >
> > Dave
> >
> > ____________________
> > BYU Unix Users Group
> > http://uug.byu.edu/
> > ___________________________________________________________________
> > List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
>
>
> ____________________
> BYU Unix Users Group
> http://uug.byu.edu/
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list