cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

How will the row characters be matched from left to right to the last decimal point using the re?

 

 

So what's left over on the right-hand side is the non-green part of each row.

 

Thanks!

20220516212519.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Craige_Hales
Super User

Re: How will the row characters be matched from left to right to the last decimal point using the re?

I think you are asking for a regex to match all but the last segment.

regex("aaa.bbb.ccc.ddd","([^\.]+\.)+")

aaa.bbb.ccc.

 

[^\.] means a single character that is not a period

[^\.]+ means one or more of those characters

[^\.]+\. means match the period

([^\.]+\.)+ means do all that one or more times

Craige

View solution in original post

Craige_Hales
Super User

Re: How will the row characters be matched from left to right to the last decimal point using the re?

regex is not the best way to attack this problem.

 

word(-1,"aaa.bbb.ccc.this is it",".") // "this is it"

will get the last segment efficiently.

 

word([1 -2],"aaa.bbb.ccc.this is it",".") // "aaa.bbb.ccc"

will get the left part efficiently.

 

Craige

View solution in original post

3 REPLIES 3
Craige_Hales
Super User

Re: How will the row characters be matched from left to right to the last decimal point using the re?

I think you are asking for a regex to match all but the last segment.

regex("aaa.bbb.ccc.ddd","([^\.]+\.)+")

aaa.bbb.ccc.

 

[^\.] means a single character that is not a period

[^\.]+ means one or more of those characters

[^\.]+\. means match the period

([^\.]+\.)+ means do all that one or more times

Craige
lala
Level IX

Re: How will the row characters be matched from left to right to the last decimal point using the re?

na1=Regex("aaa.bbb.ccc.ddd","[^\..]+$");
Craige_Hales
Super User

Re: How will the row characters be matched from left to right to the last decimal point using the re?

regex is not the best way to attack this problem.

 

word(-1,"aaa.bbb.ccc.this is it",".") // "this is it"

will get the last segment efficiently.

 

word([1 -2],"aaa.bbb.ccc.this is it",".") // "aaa.bbb.ccc"

will get the left part efficiently.

 

Craige

Recommended Articles