Re: regex query



Justin C wrote:
I've been given a regex that matches white space between the last \w on
a line and the \n at the end of the line. The regex is:

\s+(?=\n)

I understand the \s+, what is going on with the (?=\n) ?

Thank you for any help you can give with this.

It's the look-ahead. It finds the pattern by inspecting the surroundings
but without matching to them.
.



Relevant Pages

  • Re: locate regex
    ... grep and awk return the matched regular expression line. ... interested in retrieving the WORD matching the regex and not the entire ... But what I am interested in retrieving is just tpe_VerfSetting.htm ... Here teh regex is enclosed in <%@...%? ...
    (comp.lang.awk)
  • Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
    ... whole string in a RegEx, while they seem to be comfortable with partial ... matches in a string match. ... Two reasons: a special one applying here and a more general one: The ... it will be very hard for many to extend the partial matching form... ...
    (news.software.readers)
  • Re: Help beautify ugly heuristic code
    ... I'm already doing that with the rehmac regex. ... I tried matching a custom regex ... but compiling the regex for each test was too slow. ... A Bayesian classifier would have too big of a database, ...
    (comp.lang.python)
  • RE: matching in regx
    ... Subject: matching ' in regx ... with regex, and either strip it out or at least detect and error out. ...
    (perl.beginners)
  • debugger
    ... matching the regex to input text. ... As data to highlight sub-regexes which take a part in each step of ... visualize matching process. ...
    (comp.lang.perl.misc)