GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   need regex help (https://gfy.com/showthread.php?t=679761)

xuron 11-22-2006 09:45 AM

need regex help
 
I have lines that look like this

12345678:firstname

ID:Name

What is the regex code for deleting everything after the ":"

This is what I have so far, but its not getting all the characters

Code:

:[a-z\s]*$

Dvae 11-22-2006 09:57 AM

Try
.*?:(\w+)\s*$

calmlikeabomb 11-22-2006 10:04 AM

PHP Code:


$item
='12345678:firstname';

$parts=explode(':'$item);

//Outputs

$parts[0]='12345678';
$parts[1]='firstname'



All times are GMT -7. The time now is 12:54 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123