This is a known bug on the initial 2.5.1, and has been fixed in early 2007 (Redhat 2.5.1-5) according to the bug reports. Unfortunately Apple is still using 2.5.1 even on Mac OS X 10.7.2.
You could get a newer version via Homebrew (3.0) or MacPorts (2.26) or fink (3.0-1).
Edit: Apparently it has been fixed on OS X 10.11 (or maybe earlier), even though the grep version reported is still 2.5.1.
Related Posts:
- Using the star sign in grep
- How can I exclude one word with grep?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- Grep and Python
- Using Bash regex match (=~) where regex includes quotes (” characters)
- Negative matching using grep (match lines that do not contain foo)
- Validating IPv4 addresses with regexp
- RE error: illegal byte sequence on Mac OS X
- OR condition in Regex
- Using or ‘|’ in regex [duplicate]
- How do I pause my shell script for a second before continuing?
- What is a Context Free Grammar?
- What does \’.- mean in a Regular Expression
- In the shell, what does ” 2>&1 ” mean?
- How can I validate an email address using a regular expression?
- How do I grep recursively?
- Regular expression to match a line that doesn’t contain a word
- How do I grep recursively?
- Difference between \b and \B in regex
- Regex: ignore case sensitivity
- What does the regex \S mean in JavaScript?
- How can I validate an email address using a regular expression?
- In the shell, what does ” 2>&1 ” mean?
- How do I use a regex in a shell script?
- Regex: ignore case sensitivity
- Python regex AttributeError: ‘NoneType’ object has no attribute ‘group’
- Regular Expression for alphanumeric and underscores
- How to grep for case insensitive string in a file?
- What is the difference between the regular expressions [^\d\s] and [\D\S]
- Regular Expression for alphanumeric and underscores
- Regex AND operator
- python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50
- python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50
- Regex to test if string begins with http:// or https://
- Regular expression negative lookahead
- Regular Expression to match string starting with a specific word
- Regular Expressions: Is there an AND operator?
- Writing a very simple lexical analyser in C++
- How do I grep recursively?
- Regular expression to match standard 10 digit phone number
- Regular Expression.how to add optional character at end of regex
- Regular Expression with wildcards to match any character
- How can I check if a directory exists in a Bash shell script?
- What is a non-capturing group in regular expressions?
- Split string on whitespace in Python
- How to validate an email address in PHP
- What is a non-capturing group in regular expressions?
- Regular expression to match standard 10 digit phone number
- How can I exclude directories from grep -R?
- How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
- Python string.replace regular expression
- How can I exclude directories from grep -R?
- How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
- Python string.replace regular expression
- Symbol for any number of any characters in regex?
- Regex – Does not contain certain Characters
- How to replace ” \ ” with ” \\ ” in java
- A regular expression to exclude a word/string
- Regex how to match an optional character
- How to validate an email address in JavaScript
- Searching for UUIDs in text with regex
- Regular expression to match a word or its prefix
- How can I remove punctuation from input text in Java?
- Regular expression for exact match of a string
- Regex optional group
- Regex for string contains?
- Question marks in regular expressions
- Difference between \w and \b regular expression meta characters
- Extract file basename without path and extension in bash
- Given two directory trees, how can I find out which files differ by content?
- Regular Expression – Validate Gmail addresses
- Java; String replace (using regular expressions)?
- How can I remove punctuation from input text in Java?
- How can I output only captured groups with sed?
- Which characters need to be escaped when using Bash?
- How to negate specific word in regex?
- What is the grep equivalent in Python?
- javascript HTML from document.body.innerHTML
- Which regular expression operator means ‘Don’t’ match this character?
- Diff command along with Grep gives “Binary file (standard input) matches”
- Python re.split() vs split()
- How can I write a regex which matches non greedy?
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- Delete all local git branches
- cp: missing destination file operand after
- How can I match a string with a regex in Bash?
- Regex Explanation ^.*$ [duplicate]
- Grep ‘binary file matches’. How to get normal grep output?
- How to exclude a specific string constant?
- How to replace a whole line with sed?
- Regex match everything after question mark?
- How to validate phone number using PHP?
- Validate phone number with JavaScript
- What is cp: cannot stat error in Unix, I get this error when trying to copy thing from one folder to another
- Can a URL contain a semicolon and still be valid?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How is \\n and \\\n interpreted by the expanded regular expression?
- Regex to match only uppercase “words” with some exceptions
- Regular Expression to reformat a US phone number in Javascript
- Regex to match only letters