juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalitha Suranga <shalithasura...@gmail.com>
Subject Adding PatternReplaceVar to svl core
Date Thu, 08 Nov 2018 08:26:49 GMT
Hi..

If developer needs to replace some characters or erase some characters from
a variable
 is hard with current variables I think.

How about adding PatternReplaceVar ? I have my test work here
<https://github.com/apache/juneau/compare/master...shalithasuranga:patch004>
 (diff)

Here are several examples

VarResolver.DEFAULT.resolve("$PR{apple, ^a, A}"); // simply return Apple

VarResolver.DEFAULT.resolve("Java version=$PR{$S{java.version},
(_([0-9]+)), \\ build=\\$2}");

// return Java version=1.8.0 build=191 using back reference

Can we introduce this feature. your ideas?

Notice - unit cases and javadoc is not added for this test work

Thanks



-- 
Regards,
*Shalitha Suranga*

Mime
View raw message