how to regular expression match benchmark's name if the name has "$" in it

Bernd Eckenfels ecki at zusammenkunft.net
Tue Mar 7 18:51:48 UTC 2017


You must also quote on the shell
'bla\$fasel'

Gruss
Bernd
-- 
http://bernd.eckenfels.net




On Tue, Mar 7, 2017 at 5:48 PM +0100, "Bo Zhang" <bo.zh.zhang at oracle.com> wrote:










Hi Henri,

To clarify, by saying "accidentally", I mean I searched benchmarks from 
Github repository and apply them to analyze the performance of my 
hardware. I happened to find one repository using "$" in its name, which 
I believe is not a good idea and it indeed brought me trouble on regex 
match.

I tried

findAllIn\$chars\$100\$1k

before I  asked you. It does not work.

findAllIn.*100.*1k works.

Thanks a lot for help.

Best regards,

Bo



On 3/6/2017 8:40 PM, Henri Tremblay wrote:
> The name of the method should be the name of the method you have coded.
>
> How can you find a method "accidentally"? Are we talking about the 
> methods generated my JMH after compilation?
>
> Anyhow, those regex should match:
> findAllIn.*
> findAllIn.*100
> findAllIn\$chars\$100\$1k
>
>
> On 6 March 2017 at 15:12, Bo Zhang  > wrote:
>
>     Hi there,
>
>     I am using JMH to run benchmarks. I accidentally find a benchmark
>     method, whose name is "findAllIn$chars$100$1k".
>
>     In this case, how can I use regex to match this name in my "java
>     -jar ./test/benchmark.jar  " command?
>
>     Thanks,
>     Bo
>
>








More information about the jmh-dev mailing list