Does this portion of NB use standard java.util.regex or "Perl"-style
regexes?
If anyone can say yes, you could try:
{?i}<your regex>
for java.util.regex syntax
or
/<your regex>/i
for Perl style regexes.
- Phil DeJarnett
"Gili" <sittingduck@bbs.darktech.org> wrote in message
news:netbeans.nbusers/whaxoofqnexgrpubet.gzwc5w0.pminews@news.netbeans.org..
.
Hi,
Trying to build a file-filter for my JAR Recipe object.
I'm trying to use the regular-expression input method and
have it be case-insensitive. Any ideas how this can be done?
Thanks,
Gili
NetBeans uses org.apache.regexp.
You can use the MATCH_CASEINDEPENDENT flag:
new org.apache.regexp.RE("pattern", MATCH_CASEINDEPENDENT);
When using java.util.regex, there is Pattern.compile("pattern",
CASE_INSENSITIVE);
Regards,
Martin
Phil DeJarnett wrote:
>
> Does this portion of NB use standard java.util.regex or "Perl"-style
> regexes?
>
> If anyone can say yes, you could try:
>
> {?i}<your regex>
>
> for java.util.regex syntax
>
> or
>
> /<your regex>/i
>
> for Perl style regexes.
>
> - Phil DeJarnett
>
> "Gili" <sittingduck@bbs.darktech.org> wrote in message
> news:netbeans.nbusers/whaxoofqnexgrpubet.gzwc5w0.pminews@news.netbeans.org..
> .
> Hi,
>
> Trying to build a file-filter for my JAR Recipe object.
> I'm trying to use the regular-expression input method and
> have it be case-insensitive. Any ideas how this can be done?
>
> Thanks,
> Gili
Martin Entlicher wrote:
> NetBeans uses org.apache.regexp.
> You can use the MATCH_CASEINDEPENDENT flag:
> new org.apache.regexp.RE("pattern", MATCH_CASEINDEPENDENT);
>
> When using java.util.regex, there is Pattern.compile("pattern",
> CASE_INSENSITIVE);
I don't think you answered his question as such... I guess Gili means
that he is *using* the JAR Packager, not writing module code! So given
that jarpackager is compiled to do a case-sensitive match, can the regex
text itself override that, using one of the syntaxes that Phil suggested?
As far as I know Apache regexp does not support this, in which case Gili
you are out of luck (and please file a feature request).
-Jesse
>"Gili" <sittingduck@bbs.darktech.org> wrote:
>>Trying to build a file-filter for my JAR Recipe object.
>>I'm trying to use the regular-expression input method and
>>have it be case-insensitive. Any ideas how this can be done?
--
Jesse Glick <mailto:jesse.glick@sun.com> x22801
NetBeans, Open APIs <http://www.netbeans.org/>
Jesse Glick wrote:
>
> Martin Entlicher wrote:
> > NetBeans uses org.apache.regexp.
> > You can use the MATCH_CASEINDEPENDENT flag:
> > new org.apache.regexp.RE("pattern", MATCH_CASEINDEPENDENT);
> >
> > When using java.util.regex, there is Pattern.compile("pattern",
> > CASE_INSENSITIVE);
>
> I don't think you answered his question as such... I guess Gili means
> that he is *using* the JAR Packager, not writing module code! So given
> that jarpackager is compiled to do a case-sensitive match, can the regex
> text itself override that, using one of the syntaxes that Phil suggested?
Oh I see. Thanks Jesse for clarifying this.
As to java.util.regex, I don't know whether "{?i}<your regex>" can be used as
Phil suggested. I didn't found anything like this at
http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html
>
> As far as I know Apache regexp does not support this, in which case Gili
> you are out of luck (and please file a feature request).
All we can do with this is either preprocess "{?i}" before passing it to RE or
use java.util.regex when the IDE is running on JDK 1.4.x.
Please submit the feature request to Issuezilla so that it will not be
forgotten, because the jarpackager module is currently not maintained.
>
> -Jesse
>
> >"Gili" <sittingduck@bbs.darktech.org> wrote:
> >>Trying to build a file-filter for my JAR Recipe object.
> >>I'm trying to use the regular-expression input method and
> >>have it be case-insensitive. Any ideas how this can be done?
>
> --
> Jesse Glick <mailto:jesse.glick@sun.com> x22801
> NetBeans, Open APIs <http://www.netbeans.org/>
Martin Entlicher wrote:
> As to java.util.regex, I don't know whether "{?i}<your regex>" can be used as
> Phil suggested. I didn't found anything like this at
> http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html
Look under "Special constructs (non-capturing)".
> All we can do with this is either preprocess "{?i}" before passing it to RE or
> use java.util.regex when the IDE is running on JDK 1.4.x.
Also user workaround equivalent to preprocessing: replace any letter in
your RE with a character set, so replace
\.txt$
with
\.[Tt][Xx][Tt]$
Cumbersome but should work.
-Jesse
--
Jesse Glick <mailto:jesse.glick@sun.com> x22801
NetBeans, Open APIs <http://www.netbeans.org/>