Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
regex for.. well, anything?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
SpaceMarine  
View profile  
 More options Nov 4, 1:54 pm
From: SpaceMarine <spacemar...@mailinator.com>
Date: Wed, 4 Nov 2009 10:54:34 -0800 (PST)
Local: Wed, Nov 4 2009 1:54 pm
Subject: regex for.. well, anything?
hello,

im a seasoned programmer but a regex newb. ive read some excellent
tutorials over the years, but i still often find myself starting all
over with baby steps when it comes to regexes. dunno why.

i need to plug in a regex into a software tool that validates a
string. for this particular string, i dont care *what* the value is,
just that it has one. what is the best way to write this supremely
easy requirement?

thanks,
sm


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugeny Sattler  
View profile  
 More options Nov 5, 2:39 am
From: Eugeny Sattler <eugeny.satt...@gmail.com>
Date: Thu, 5 Nov 2009 11:39:59 +0400
Local: Thurs, Nov 5 2009 2:39 am
Subject: Re: regex for.. well, anything?
Fist of all i think it is easier to check without regexes using
built-in functions like  IsEmpty() function or  logical "is Not NULL"
check
Calling for regex library will take additional time.

As for regex approach:
1) I think a presence of non-space character is a sign that the field
contains a value.
So the regex would be simple:

\S

2) If you are happy with just spaces or tabs or any other invisible
characters, as well .....
In this case the regex would be just the all-capturing dot:
.

Can you see it well above ? :)

Lack of boundaries \b and anchors (^, $, \A, \Z) ensures that this
regex allows this any symbol to be located in any place of a target
string (in the beginning, at the end, in the middle)


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SpaceMarine  
View profile  
 More options Nov 5, 4:19 pm
From: SpaceMarine <spacemar...@mailinator.com>
Date: Thu, 5 Nov 2009 13:19:01 -0800 (PST)
Local: Thurs, Nov 5 2009 4:19 pm
Subject: Re: regex for.. well, anything?

> Fist of all i think it is easier to check without regexes using
> built-in functions

impossible in this scenario. thus my post :)

\S sounds like the winner.

thanks!
sm

On Nov 5, 1:39 am, Eugeny Sattler <eugeny.satt...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SpaceMarine  
View profile  
 More options Nov 20, 4:35 pm
From: SpaceMarine <spacemar...@mailinator.com>
Date: Fri, 20 Nov 2009 13:35:04 -0800 (PST)
Local: Fri, Nov 20 2009 4:35 pm
Subject: Re: regex for.. well, anything?
update on this...

i'm using HP's Quick Test Pro, an enterprise scripting tool designed
to record and verify front-end application use (regression testing).
in it, designating a GUI textbox with the \S pattern (meaning, the
textbox may contain anything) does not work; tests don't pass.

however, using .* as the pattern does work.

sm

On Nov 5, 3:19 pm, SpaceMarine <spacemar...@mailinator.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eugeny.Sattler@gmail.com  
View profile  
 More options Nov 21, 5:31 am
From: "Eugeny.Satt...@gmail.com" <eugeny.satt...@gmail.com>
Date: Sat, 21 Nov 2009 02:31:53 -0800 (PST)
Local: Sat, Nov 21 2009 5:31 am
Subject: Re: regex for.. well, anything?

> the \S pattern (meaning, the
> textbox may contain anything) does not work; tests don't pass.

> however, using .* as the pattern does work.

I think it is because of the following.
If the software requires "the whole string should be matched",
indeed .* is the right thing to use.

if the software applies "find a substring is enough"
approach , then \S should suffice.
\S might be not supported - in this case [^\s] which is the same, can
be used.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google