in reply to Re: Excluding Words in RegEx
in thread Excluding Words in RegEx

should we need to escape . ?

/^(?!.*\bgroup\b)(\d{4}) (^.+?.\!\?)$/

is good enough? \. and . does the same thing? any takers?

Replies are listed 'Best First'.
Re^3: Excluding Words in RegEx
by Lotus1 (Vicar) on Nov 06, 2011 at 16:04 UTC

    Good point that within a character class '.' does not need to be escaped with a backslash. However, you need to use <code></code> tags around it in your post so the [] aren't rendered as links.

Re^3: Excluding Words in RegEx
by ikegami (Patriarch) on Nov 07, 2011 at 04:35 UTC
    I just copied the OP's pattern. But yeah,
    /^(\d{4}) ([^\.]+?[\.\!\?])$/

    can be shortened to

    /^(\d{4}) ([^.]+?[.!?])$/