non-existant regexp function

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

non-existant regexp function

Postby Takamatsu » Sun Sep 07, 2003 9:31 pm

I noted this regexp function doesn't exist in newsbin.

In my early experience with regexp, I have encountered an application which uses the following syntax.

{1,10}

Which means... "at least 1 of the previous character, and at most 10."

For example.
[0-9]{1,5} will match numeric strings ranging from 0 to 99999.

I take it that this is a non-standard syntax, but it is obviously very powerful and useful.
User avatar
Takamatsu
Active Participant
Active Participant
 
Posts: 69
Joined: Sat Aug 16, 2003 12:50 pm

Registered Newsbin User since: 04/08/03

Postby Smite » Mon Sep 08, 2003 2:58 am

For now, you can write it out longhand:
[0-9]{1,5} = [0-9][0-9]?[0-9]?[0-9]?[0-9]?
User avatar
Smite
Katamari Damacy Addict
 
Posts: 5318
Joined: Sat May 19, 2001 1:54 am
Location: Alberta, Canada

Registered Newsbin User since: 03/27/03


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 25 guests