[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Regex expert needed

On Saturday 30 April 2005 03:42 pm, Alan Chandler wrote:
> I am using PHP and I am trying to parse a string into substrings delimited by 
> a single character. In some instances this is a ',' in others it will be '='.
> I think the php function preg_split is the one to use, but I need find the 
> right regular expression to match the delimeter character.  Not being an 
> expert and seeing its just not an obvious single character (see below) it has 
> confused me completely.
> Unfortunately a subset of the substrings themselves may have ',' or '=' signs 
> in them, although each string in this subset will itself have had the 
> addslashes() function performed on it to escape internal quote characters and 
> then completely surrounded in a pair of single quote characters.
> In otherwords my regular expression does not want to match a ',' (or in the 
> other case a '=') if it is inside an unescaped quote.
> So can any regular expression experts out there help me define the right one 
> to match the criteria I have described.
> -- 
> Alan Chandler
> http://www.chandlerfamily.org.uk

You know...  if I ask this sorta question all I get is RTFM and in reality that's the correct answer...  When I had regex questions I 
bought a couple books and spent hours and hours reading and experimenting till I figured out what I needed...  My personal thoughts 
here is, this guys' gettin a free pass... while I ask for help on a legitimate topic like my apt CDROM method fuckin up and nobody gives it a second look...


Attachment: pgpZPpk5Uh9x3.pgp
Description: PGP signature

Reply to: