Re: Can't get this regular expression figured out



On Jul 27, 3:08 am, "slebet...@xxxxxxxxx" <slebet...@xxxxxxxxx> wrote:
On Jul 27, 12:43 am, Andrew Falanga <af300...@xxxxxxxxx> wrote:

I'm trying to
figure out how the regular expression should look to match any
characters other than decimal numbers and '-'.


Personally, if I understand your description of the input format
correctly, I'd use the pattern:

{^(\d+(-\d+)?\s+)*\d+(-\d+)?$}

That regex might tell the OP whether what was typed was right or not.
But another expression would be needed to achieve the goal of "match
any character other than decimal numbers and '-' (and white space, of
course).




.



Relevant Pages

  • Re: Expert script (.bat) writers help needed (strip double-quote from string)
    ... Sets or returns the regular expression pattern being searched for. ... Always a RegExp object variable. ... May include any of the regular expression characters defined in the table in the Settings section. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Regex. How can this match?
    ... The Regex which ended up working as I wanted is ... changed my mind about what characters to capture... ... I have written the Regular Expression ... Group, Capture, Set options ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Regex question
    ... I didn't know the range would be that much different from SQL ... The problem is that my regex only gets ... should write a regex pattern that matches _that_, ... remove all the characters from the string that aren't digits or '/' ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Simple find question
    ... reason it is not behaving as a regular expression should. ... matches any string which is empty or matches r. ... So in the following lines the lhs pattern is equivalent to rhs regex: ...
    (comp.unix.shell)
  • Re: Regular expression question
    ... Then I think a regular expression such as: ... > Here's a small method that'll build the appropriate regex expression ... > lookbehind assertion wrapped in a non-capturing group. ... > characters at the beginning of the string that you want discarded. ...
    (microsoft.public.dotnet.languages.csharp)