Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Highlight Filter Capture Regex #292
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
The code before whilst passing all tests was failing in production for a capture highlight at the beginning of the text. I have added new tests for this case and updated the code.
The new code results in 2 regex searches for capture highlight, this could be reduced to 1 regex but would increase the LOC with if/else
Looks good to me. @garethdjames - from what I gather the
I played with it in a fiddle: http://jsfiddle.net/joseym/T5uGQ/
I noticed that
I kindof wonder what the point is ... if the regular match accepts regular expressions why have an option to force the match to be a regular expression?
The purpose of the parameter was to enable a case where you wanted to enter a regex that would include a capture, i.e. to capture part (or all) of the data.
My use case involves a user writing a regex that will filter (using a () capture) part of the string (in this case a URL). I wanted to show the captured part as highlighted.
given the string http://www.somesite.com/index.html?a=b&c=d
and the regex http://(.*)?
the highlight would look like this
(I'm using 'bold' as the highlight in this email).
If you think this is something worth adding then I can rework it, otherwise I will just add a filter to my own project
On Monday, 4 February 2013 at 21:53, Josey Morton wrote:
Yes needs a bit more work to get it right
Will update later
On Tuesday, 5 February 2013 at 15:35, Josey Morton wrote: