CodeIgniter Forums

Full Version: Alright regex masters... help...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Brandon Dickson[/eluser]
I need to pull

C:\Documents and Settings\dicksonb\Desktop\ajax-loader.gif

from:
Code:
L���###�����À������F›��� ���²AÙ#v3È#–²ú>v3È#n#I#v3È#. ������#���������������T�R�2�. ��~7G‹ �AJAX-L~1.GIF��6�#�#�ï¾~7J‹~7G‹#���a�j�a�x�-�l�o�a�d�e�r�.�g�i�f���#���t���#���#���#���8�������s���#���#���#ú—À#���IBM_PRELOAD�C:\Documents and Settings\dicksonb\Desktop\ajax-loader.gif��I�.�.�\�.�.�\�.�.�\�.�.�\�.�.�\�.�.�\�D�o�c�u�m�e�n�t�s� �a�n�d� �S�e�t�t�i�n�g�s�\�d�i�c�k�s�o�n�b�\�D�e�s�k�t�o�p�\�a�j�a�x�-�l�o�a�d�e�r�.�g�i�f�*�C�:�\�D�o�c�u�m�e�n�t�s� �a�n�d� �S�e�t�t�i�n�g�s�\�d�i�c�k�s�o�n�b�\�D�e�s�k�t�o�p�`���#�� X�������nissa�����������°$}Bô#éJ‡¹‚Ò"N#U(EM•lÜ#±)�#AC#^°$}Bô#éJ‡¹‚Ò"N#U(EM•lÜ#±)�#AC#^����

and I've gotten

Code:
'/.*(\w:\\\[^\x3F]+).*/'

so far which gives me

Code:
C:\Documents and Settings\dicksonb\Desktop\ajax-loader.gif��I�.�.�\�.�.�\�.�.�\�.�.�\�.�.�\�.�.�\�D�o�c�u�m�e�n�t�s� �a�n�d� �S�e�t�t�i�n�g�s�\�d�i�c�k�s�o�n�b�\�D�e�s�k�t�o�p�\�a�j�a�x�-�l�o�a�d�e�r�.�g�i�f�*�C�:�\�D�o�c�u�m�e�n�t�s� �a�n�d� �S�e�t�t�i�n�g�s�\�d�i�c�k�s�o�n�b�\�D�e�s�k�t�o�p�`���#�� X�������nissa�����������°$}Bô#éJ‡¹‚Ò"N#U(EM•lÜ#±)�#AC#^°$}Bô#éJ‡¹‚Ò"N#U(EM•lÜ#±)�#AC#^����

I figured that [^\x3F]+ would match anything that's not \x3F ( the '?' ) one or more times, and as soon as it finds an \x3F it would close the group...

any ideas?

Thanks!
-Brandon

El Forum

[eluser]Sean Murphy[/eluser]
This seems to do it. It requires a file extension though.
Code:
/[A-Z]:(?:(?:\\|/)[^<>:"/\\]+)+\.[\w]+/