I need to truncate a title field from Links SQL to all the text preceding the first ampersand (&) or (,). Does anybody know the regex expression for such a feat? Regex looks really intimidating but I know it can be done.
Aug 22, 2003, 12:42 AM
Veteran / Moderator (17297 posts)
Aug 22, 2003, 12:42 AM
Post #2 of 2
Views: 1001
Maybe something like;
$var =~ m,(.+?)(\&|\,),,gi and my $beginning = $1;
That should assign the bit before the first & or comma.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
$var =~ m,(.+?)(\&|\,),,gi and my $beginning = $1;
That should assign the bit before the first & or comma.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

