Re: Get regular expression
- From: "Xicheng Jia" <xicheng@xxxxxxxxx>
- Date: 20 Jun 2006 15:28:08 -0700
Mike wrote:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in
matches. I would like to get what the actual regular expression is.
In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART (CONDUCTION
DEFECT) 37.33/2 HEART (CONDUCTION DEFECT) WITH
CATHETER 37.34/2 " the expression is "HEART (CONDUCTION DEFECT)". How
do I gain access to the expression (not the matches) at runtime?
you want to access the expression "HEART (CONDUCTION DEFECT)" or the
regex "^(.+)(?=\s*).*\1" at run-time?? dont think you can get exactly
the latter one though, for the previous one, you can use named capture,
like
^(?<expr>.+)(?=\s*).*\k<expr>
and access the variable "expr" at run time?
Xicheng
.
- Follow-Ups:
- Re: Get regular expression
- From: Mike
- Re: Get regular expression
- References:
- Get regular expression
- From: Mike
- Get regular expression
- Prev by Date: collection class performance seems SLOOOWWWWWW
- Next by Date: Re: Get regular expression
- Previous by thread: Get regular expression
- Next by thread: Re: Get regular expression
- Index(es):
Relevant Pages
|