1. Jay Hastings
  2. PowerBuilder
  3. Wednesday, 22 February 2023 22:33 PM UTC

I've not used regular epxressions much.  I'm looking for a simple expression for alphanumeric, with some characters like / \ - _ and .

I had Match(GetText(), "^[A-Za-z0-9.-_]+$") in the Validation Expresssion of the datawindow but I know that's not right.

Any help would be appreciated....if I stare at the HELP any longer I'll scream.

Thanks in advance

 

Jay

 

Jay Hastings Accepted Answer Pending Moderation
  1. Friday, 24 February 2023 02:13 AM UTC
  2. PowerBuilder
  3. # 1

Sorry...I know I resolved this, but any tips on the message.  I put something in the Validation Message which pops up but when I click OK...it pops up again with a window that's behind my app.  So maybe File Explorer with the error message on top that.  Weird.

 

Thanks

Jay

Comment
  1. John Fauss
  2. Friday, 24 February 2023 02:39 AM UTC
I think you should pose this a new question, Jay, and try to provide some more detailed information, such as screen shot(s), what you put in the validation message, the text of the message, and where that code resides. The Community prefers to keep each thread focused on a single question/topic.
  1. Helpful
There are no comments made yet.
Jay Hastings Accepted Answer Pending Moderation
  1. Wednesday, 22 February 2023 23:19 PM UTC
  2. PowerBuilder
  3. # 2

Perfect....thanks and that makes a little more sense now.

 

Jay

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 22 February 2023 22:50 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Jay -

I like to utilize the backslash (\) character to specify any non-alphanumeric characters within the match string. Here's what it does:

I would code the example you gave like this:

Match(GetText(), "^[A-Za-z0-9\.\-\_]+$")

It works with all non-alphanumeric characters, as far as I know...even the backslash itself! Even though it increases the length of the match string (a little), I think it improves its legibility.

Best 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.