Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

New help for this regexp for number + fixed string

Last post 02-23-2012, 4:41 PM by Aussie Susan. 1 replies.
Sort Posts: Previous Next
  •  02-23-2012, 10:10 AM 84697

    New help for this regexp for number + fixed string

    I need help to setup a regexp with the following pattern.

    I want to find all lines which match:

    <arbitrary number (even 0) of chars,digits or special chars><one or more blanks><1 or more digits with or without multiple dots inside e.g. 8.1.233.33><one or more blanks><string without quotes "aabbccdd"><arbitrary number (even 0) of chars,digits or special chars>

    How would such a regexp look like?

    Peter

  •  02-23-2012, 4:41 PM 84699 in reply to 84697

    Re: New help for this regexp for number + fixed string

    Can you please let us know the regex variant you are using? While they generally perform the same operation, there are functional and syntactic differences between them all.

    I'm making a few assumptions (such as "<arbitrary number (even 0) of chars,digits or special chars>" is another way of saying "0 or more non-whitespace characters") and it would be nice to have some sample text to work with. However try this:

    ^\S*\s+[\d.]+\s+[a-z]+\S*$

    with the "ignore case" option set. If you are presenting a block of text and expect the regex to process each line, then you will also need the "multiline" option set.

    I have not tested this pattern but it should be close.

    Susan

View as RSS news feed in XML