RE: regexp quickie
[email protected] Wed, 27 Jun 2007 14:48:39 -0500
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <A3B4E948E728054CAC7A6D9C55EAB6A301F713C7@houic-s-348.americas.shell.com> |
> If you want $2 to only ever be the first letter at or after the target
> location, you can just tweak the second half of the regex:
>=20
> /^(?=3D.{0,$r}([^_]))?(?:.{$r}.*?([^_]))?/
Save a stroke:
/^(?=3D.{0,$r}([^_]))?(?:.{$r,}?([^_]))?/
Roy