Regular Expressions

Bill Marcum marcumbill at bellsouth.net
Tue May 29 02:40:15 UTC 2007


["Followup-To:" header set to gmane.linux.ubuntu.user.]
On Sun, 27 May 2007 21:27:26 +0530, Kaushal Shriyan 
  <kaushalshriyan at gmail.com> wrote:
> --===============0458939522==
> Content-Type: multipart/alternative; 
> 	boundary="----=_Part_23939_32956483.1180281446204"
>
> Hi
>
> I have created a regex for the below smb URLs
>
> smb://ab-03.nea.nl/RegSec/Arch2006/Wanders/
> smb://ab-03.nea.nl/RegSec/Arch2006/Wdivers/
> smb://ab-03.nea.nl/RegSec/Arch2006/Wofferte/
> smb://ab-03.nea.nl/RegSec/Arch2006/Wrapport/
> smb://ab-03.nea.nl/RegSec/Arch2005/Wanders/
> smb://ab-03.nea.nl/RegSec/Arch2005/Wdivers/
> smb://ab-03.nea.nl/RegSec/Arch2005/Wofferte/
> smb://ab-03.nea.nl/RegSec/Arch2005/Wrapport/
>
> regex:^smb://ab-03.nea.nl/RegSec/Arch200[0-9]+/W[a-z]+/$
>
> is there a way to check whether my regex is valid and I am sure i am missing
> something. Please correct me if my regex is wrong.
>
Create a file that contains some data which should match the regex and 
some which should not. Then test it with
grep -E 'regex' filename


> Thanks in Advance.
>
> Thanks and Regards,
>
> Kaushal
>
> ------=_Part_23939_32956483.1180281446204
> Content-Type: text/html; charset=ISO-8859-1
Please don't post in html.



-- 
The right half of the brain controls the left half of the body.  This
means that only left handed people are in their right mind.





More information about the ubuntu-users mailing list