if u use
(?:(He)ll(o))
then group #1 will return *He*
and group #2 will return *o*
and u cannot really split the whole match *hello* [i.e.
group #0] ,
it'll be there anyway.
On Aug 14, 5:17 pm, brian <bdun... dunbarconsulting.org>
wrote:
> I am trying to match a string and leave part of the
match out of the
> matching group. For example:
>
> Source String:
>
> Hi Hello Hi
>
> Regex that almost does what I want:
>
> .*(He(?:ll)o).*
>
> $1 returns "Hello" and what I want is
"Heo", with the two l's removed
> corresponding to the non-capturing group.
>
> Is what I want doable?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|