๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
18 messages
18 total messages Started by Mozzy Tue, 20 Jul 2004 10:13
[OT] Help with regex please
#152116
Author: Mozzy
Date: Tue, 20 Jul 2004 10:13
22 lines
1410 bytes
I am trying to match a string like these file names:

           109006310240F90AFE3D10Fjpg
           109022208940FB7809F1BBBjpg

where there are any 23 characters followed by "jpg".  Strangely 
enough there is no dot before the "jpg" at the end of the file 
name.

I have used this regex test page but I can't seem to get any regex 
to work!   http://www.fileformat.info/tool/regex.htm

Among others I have tried these

    jpg   =  jpg anywhere
    jpg$  =  jpg at end of string
    \$jpg =  jpg at end of string
    \Zjpg =  jpg at end of name

Why don't these work?  

What regex should I use to match those file names?
Re: [OT] Help with regex please
#152117
Author: nospam
Date: Tue, 20 Jul 2004 11:09
17 lines
1291 bytes
Mozzy <dem_d@mail.com> wrote:

>I am trying to match a string like these file names:
>
>           109006310240F90AFE3D10Fjpg
>           109022208940FB7809F1BBBjpg
>
>where there are any 23 characters followed by "jpg".  Strangely 

>
>What regex should I use to match those file names?

.......................jpg

should match any 23 character followed by jpg.

Re: [OT] Help with regex please
#152119
Author: Rom
Date: Tue, 20 Jul 2004 11:34
19 lines
1353 bytes
On Tue, 20 Jul 2004 11:13:26 +0100, Mozzy rambled:

> I am trying to match a string like these file names:
> 
>            109006310240F90AFE3D10Fjpg
>            109022208940FB7809F1BBBjpg
> 
> where there are any 23 characters followed by "jpg".  Strangely 
> enough there is no dot before the "jpg" at the end of the file 
> name.

> What regex should I use to match those file names?

Until someone more knowledgable comes along, try this:

	^(?>.*)(?<=jpg)

-- 
Rom
Re: [OT] Help with regex please
#152122
Author: MLC
Date: Tue, 20 Jul 2004 12:38
35 lines
2200 bytes
martedรฌ 20/lug/2004 _Mozzy_ in <news:952C722D5471651A7E@130.133.1.4>:

> I am trying to match a string like these file names:
> 
>            109006310240F90AFE3D10Fjpg
>            109022208940FB7809F1BBBjpg
> 
> where there are any 23 characters followed by "jpg".  Strangely 
> enough there is no dot before the "jpg" at the end of the file 
> name.
> 
> I have used this regex test page but I can't seem to get any regex 
> to work!   http://www.fileformat.info/tool/regex.htm
> 
> Among others I have tried these
> 
>     jpg   =  jpg anywhere
>     jpg$  =  jpg at end of string
>     \$jpg =  jpg at end of string
>     \Zjpg =  jpg at end of name
> 
> Why don't these work? 

That page doesn't work for me either. :-/
 
> 
> What regex should I use to match those file names?

^\w{23}jpg

this works here in Dialog's regex tester with your strings.

HTH
-- 
Maria Luisa C - 20/07/2004 13.44.11
Re: [OT] Help with regex please
#152155
Author: Neil Woods
Date: Tue, 20 Jul 2004 20:08
35 lines
1840 bytes
Mozzy <dem_d@mail.com> writes:
> I am trying to match a string like these file names:
>
>            109006310240F90AFE3D10Fjpg
>            109022208940FB7809F1BBBjpg
>
> where there are any 23 characters followed by "jpg".  Strangely 
> enough there is no dot before the "jpg" at the end of the file 
> name.
>
> I have used this regex test page but I can't seem to get any regex 
> to work!   http://www.fileformat.info/tool/regex.htm
>
> Among others I have tried these
>
>     jpg   =  jpg anywhere
>     jpg$  =  jpg at end of string
>     \$jpg =  jpg at end of string
>     \Zjpg =  jpg at end of name
>
> Why don't these work?  

Because they're wrong ;)

>
> What regex should I use to match those file names?

Assuming the test string (the bit before the final jpg) consists of 
hexadecimal characters, then

^[0-9A-F]{23}jpg$

would match.

Neil.
Re: [OT] Help with regex please
#152159
Author: Blinky the Shark
Date: Tue, 20 Jul 2004 21:21
13 lines
1426 bytes
Mozzy wrote:

> I am trying to match a string like these file names:

There are different flavors of regex.  If the identity of the program
you're trying to use really *doesn't* have to remain a secret for
national security purposes, you might say what it is.

-- 
Blinky                                Linux Registered User 297263

New Pieces of Shakespeare Manuscript Found Near Salt Lake City USA
Sorry - penguins only:  http://snipurl.com/scolius  (at blinkynet)
Re: [OT] Help with regex please
#152172
Author: Murray Peterson
Date: Wed, 21 Jul 2004 01:18
12 lines
1402 bytes
Mozzy <dem_d@mail.com> wrote in news:952C722D5471651A7E@130.133.1.4:

> What regex should I use to match those file names?

It depends on what tool you are using.  Regular expression details vary, so 
you need to give us more information.  Is this a C# program?  Xnews?  
emacs?  grep?

-- 
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Re: [OT] Help with regex please
#152194
Author: Tech Zero
Date: Wed, 21 Jul 2004 07:22
46 lines
2230 bytes
The voice of "Mozzy" drifted in on the cyber-winds, 
from the sea of virtual chaos...

> I am trying to match a string like these file names:
> 
>            109006310240F90AFE3D10Fjpg
>            109022208940FB7809F1BBBjpg
> 
> where there are any 23 characters followed by "jpg".  Strangely 
> enough there is no dot before the "jpg" at the end of the file 
> name.
 <snip>
> What regex should I use to match those file names?


Unlike "Binky" & "Murry", I quite certain you're using a hacked version 
of Xnews, so the following would work:

    \w{23}\.jpg\b

That's also assuming you mean any file with 23 random characters with a 
"jpg" extension.


As for the other "demo" Regex strings...

>    jpg   =  jpg anywhere

Will capturer any word with those three characters, so it's not 
accurate.

>    jpg$  =  jpg at end of string

There is often a spaces after the file names on most Usenet spam, so 
this won't work ether.

>    \$jpg =  jpg at end of string

Never seen before; it's not PCRE, so it doesn't work in Xnews.

>    \Zjpg =  jpg at end of name

Again, it's not PCRE...

-- 
The Tech Zero, Maxx "What's That Score" Pollare...
Re: [OT] Help with regex please
#152195
Author: Mozzy
Date: Wed, 21 Jul 2004 09:17
45 lines
2007 bytes
Tech Zero <july-spamail@dragonfur.ca> wrote:

> Unlike "Binky" & "Murry", I quite certain you're using a
> hacked version of Xnews, so the following would work:
> 
>     \w{23}\.jpg\b


Not clear about why you say (a) it is hacked or (b) why the regex 
you give would presumably work with a hacked version but not a non-
hacked version.


> That's also assuming you mean any file with 23 random
> characters with a "jpg" extension.
> 

Yes.

> 
> As for the other "demo" Regex strings...
> 
>>    jpg   =  jpg anywhere
> 
> Will capturer any word with those three characters, so it's
> not accurate.
> 
>>    jpg$  =  jpg at end of string
> 
> There is often a spaces after the file names on most Usenet
> spam, so this won't work ether.

Interesting point.  Aren't the trailing spaces stripped out by 
either the newsreader or the operating system?

> 
>>    \$jpg =  jpg at end of string
> 
> Never seen before; it's not PCRE, so it doesn't work in Xnews.
> 
>>    \Zjpg =  jpg at end of name
> 
> Again, it's not PCRE...

Does PCRE = "proper 'C' regeular expression" ?
Re: [OT] Help with regex please [uncancelled post]
#152196
Author: Mozzy
Date: Wed, 21 Jul 2004 09:19
47 lines
2012 bytes
Tech Zero <july-spamail@dragonfur.ca> wrote:

> Unlike "Binky" & "Murry", I quite certain you're using a
> hacked version of Xnews, so the following would work:
> 
>     \w{23}\.jpg\b


I am asking about regex as used by Newsbin Pro.

BTW why would the regex you give work with a hacked version but
not a non-hacked version of a program? 


> That's also assuming you mean any file with 23 random
> characters with a "jpg" extension.
> 

Yes.

> 
> As for the other "demo" Regex strings...
> 
>>    jpg   =  jpg anywhere
> 
> Will capturer any word with those three characters, so it's
> not accurate.
> 
>>    jpg$  =  jpg at end of string
> 
> There is often a spaces after the file names on most Usenet
> spam, so this won't work ether. 

Interesting point.  Aren't the trailing spaces stripped out by 
either the newsreader or the operating system?

> 
>>    \$jpg =  jpg at end of string
> 
> Never seen before; it's not PCRE, so it doesn't work in Xnews.
> 
>>    \Zjpg =  jpg at end of name
> 
> Again, it's not PCRE...

Does PCRE = "proper 'C' regeular expression" ?
Re: [OT] Help with regex please
#152197
Author: Mozzy
Date: Wed, 21 Jul 2004 09:19
20 lines
1485 bytes
Rom <reply@group.invalid> wrote:

>> I am trying to match a string like these file names:
>> 
>>            109006310240F90AFE3D10Fjpg
>>            109022208940FB7809F1BBBjpg 
>> 
>> where there are any 23 characters followed by "jpg". 
>> Strangely enough there is no dot before the "jpg" at the end
>> of the file  name. 
> 
>> What regex should I use to match those file names?
> 
> Until someone more knowledgable comes along, try this:
> 
>      ^(?>.*)(?<=jpg)


Yikes!  I am bamboozled by that expression.  Can anyone explain the 
essence of it as I am intrigued.
Re: [OT] Help with regex please
#152198
Author: Mozzy
Date: Wed, 21 Jul 2004 09:20
11 lines
1249 bytes
Murray Peterson <mwp@home.com.invalid> wrote:

>> What regex should I use to match those file names?
> 
> It depends on what tool you are using.  Regular expression
> details vary, so you need to give us more information.  Is
> this a C# program?  Xnews?  emacs?  grep?


Am using Newbin Pro.  The regex is used to filter out file and 
subject names of binaries.
Re: [OT] Help with regex please
#152199
Author: Mozzy
Date: Wed, 21 Jul 2004 09:36
20 lines
1479 bytes
Rom <reply@group.invalid> wrote:

>> I am trying to match a string like these file names:
>> 
>>            109006310240F90AFE3D10Fjpg
>>            109022208940FB7809F1BBBjpg 
>> 
>> where there are any 23 characters followed by "jpg". 
>> Strangely enough there is no dot before the "jpg" at the end
>> of the file  name. 
> 
>> What regex should I use to match those file names?
> 
> Until someone more knowledgable comes along, try this:
> 
>      ^(?>.*)(?<=jpg)


For some reason Newsbin Pro does not permit me to add that 
expression into its filter(s).  :-(
Re: [OT] Help with regex please
#152200
Author: Mozzy
Date: Wed, 21 Jul 2004 09:37
37 lines
1862 bytes
MLC <maluc52@yahoo.it> wrote:

>> I am trying to match a string like these file names:
>> 
>>            109006310240F90AFE3D10Fjpg
>>            109022208940FB7809F1BBBjpg 
>> 
>> where there are any 23 characters followed by "jpg". 
>> Strangely enough there is no dot before the "jpg" at the end
>> of the file  name. 
>> 
>> I have used this regex test page but I can't seem to get any
>> regex to work!   http://www.fileformat.info/tool/regex.htm
>> 
>> Among others I have tried these
>> 
>>     jpg   =  jpg anywhere
>>     jpg$  =  jpg at end of string
>>     \$jpg =  jpg at end of string
>>     \Zjpg =  jpg at end of name
>> 
>> Why don't these work? 
> 
> That page doesn't work for me either. :-/
>  
>> 
>> What regex should I use to match those file names?
> 
> ^\w{23}jpg
> 
> this works here in Dialog's regex tester with your strings.
> 


For some reason your regex ^\w{23}jpg does not work in Newsbin Pro.

:-(
Re: [OT] Help with regex please
#152255
Author: Mozzy
Date: Wed, 21 Jul 2004 09:38
13 lines
1177 bytes
Neil Woods <neil@suespammers.org> wrote:

>> What regex should I use to match those file names?
> 
> Assuming the test string (the bit before the final jpg)
> consists of hexadecimal characters, then
> 
> ^[0-9A-F]{23}jpg$
> 
> would match.


I had been using this but it doesn't seem to work in Newsbin Pro.
Re: [OT] Help with regex please
#152203
Author: Mozzy
Date: Wed, 21 Jul 2004 09:39
12 lines
1306 bytes
Blinky the Shark <no.spam@box.invalid> wrote:

>> I am trying to match a string like these file names:
> 
> There are different flavors of regex.  If the identity of the
> program you're trying to use really *doesn't* have to remain a
> secret for national security purposes, you might say what it
> is. 


Newsbin Pro.  This might explain why several regexes offered by 
posters work for them but not in my Newsbin Pro.
Re: [OT] Help with regex please [uncancelled post]
#152204
Author: Tech Zero
Date: Wed, 21 Jul 2004 11:21
48 lines
2623 bytes
The voice of "Mozzy" drifted in on the cyber-winds, 
from the sea of virtual chaos...

>> Unlike "Binky" & "Murry", I quite certain you're using a
>> hacked version of Xnews, so the following would work:
>> 
>>     \w{23}\.jpg\b
> 
> I am asking about regex as used by Newsbin Pro.

OK... So Your not using Xnews...  };8)

This will help:  http://www.newsbin.com/regexp.htm

It doesn't say if it uses PRCE, but it looks the same. If the above 
doesn't work (with "'" as the escape character), then try this:

   ([a-zA-Z1-9]){23}'.jpg

> BTW why would the regex you give work with a hacked version but
> not a non-hacked version of a program? 

You thinking "Exclusive OR", when I was writing just "OR"...  };8)
 
>>>    jpg$  =  jpg at end of string
>> 
>> There is often a spaces after the file names on most Usenet
>> spam, so this won't work ether. 
> 
> Interesting point.  Aren't the trailing spaces stripped out by 
> either the newsreader or the operating system?

Not in headers, and only in body of OE posted messages AFAIK...
 
>>>    \$jpg =  jpg at end of string
>> 
>> Never seen before; it's not PCRE, so it doesn't work in Xnews.
>> 
>>>    \Zjpg =  jpg at end of name
>> 
>> Again, it's not PCRE...
> 
> Does PCRE = "proper 'C' regeular expression" ?

Perl Compatible Regular Expression; it's what Xnews uses.

-- 
The Tech Zero, Maxx "What's That Score" Pollare...
Re: [OT] Help with regex please
#152216
Author: Murray Peterson
Date: Wed, 21 Jul 2004 16:25
22 lines
1866 bytes
Mozzy <dem_d@mail.com> wrote in news:952D69439300651A7E@130.133.1.4:

> Murray Peterson <mwp@home.com.invalid> wrote:
> 
>>> What regex should I use to match those file names?
>> 
>> It depends on what tool you are using.  Regular expression
>> details vary, so you need to give us more information.  Is
>> this a C# program?  Xnews?  emacs?  grep?
> 
> 
> Am using Newbin Pro.  The regex is used to filter out file and 
> subject names of binaries.

Sorry, I won't be able to help you with specifics, since I don't have 
Newsbin Pro running on my machine.  If it accepts repeat counts, then my 
best suggestion would be: [0-9a-f]{23}jpg

-- 
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads