1. Andrey Dudochkin
  2. PowerBuilder
  3. Monday, 31 August 2020 16:03 PM UTC

Hi,

Why regular expression match('','^[0-9, ]*$') = false ?

* (asterisk) Indicates zero or more occurrences

An empty string must meet the condition.

 

Regards,

Andrey

 
Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Monday, 31 August 2020 20:02 PM UTC
  2. PowerBuilder
  3. # Permalink
1
Votes
Undo

From the PB Help (bold italics are mine):

Return value

Boolean.

Returns true if string matches textpattern and false if it does not. Match also returns false if either argument has not been assigned a value or the pattern is invalid. If any argument's value is null, Match returns null.

Comment
Greetings, John

Thanks for your reply.



I assumed it should be like this:

match('','^[0-9, ]*$') = true

match('','^[0-9, ]+$') = false
  1. Andrey Dudochkin
  2. Tuesday, 1 September 2020 06:17 AM UTC
An empty string will never match any pattern in PB because it's always being interpreted as not having been assigned a value. That's not the "correct" behaviour for a regular expression but it's how the function is implemented at the moment.
  1. Benjamin Gaesslein
  2. Thursday, 18 March 2021 10:04 AM UTC
There are no comments made yet.
Nguyen Xuan Huy Accepted Answer Pending Moderation
  1. Thursday, 18 March 2021 08:53 AM UTC
  2. PowerBuilder
  3. # 1
0
Votes
Undo

Hi ,

 

I have a question related Match pattern in PB.

Is "match" work like "REGEXP_LIKE" of oracle?

"select 'jj' from dual where REGEXP_LIKE( 'ada;abc;yrhfjs;37;hgs', '(abc)+*([3][6-9]|[4-9][0-9])')"

I would like to do the same for filtering datawindow by MATCH PB Function. Thanks

 

Best regards

Huy

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 31 August 2020 16:36 PM UTC
  2. PowerBuilder
  3. # 2
0
Votes
Undo

Greetings, Andrey - 

Could you please tell us EXACTLY, in words, what you are wanting to test via the Match PowerScript function? Then we can help supply you with an example that does what you want.

Regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.