Ask a Question related to ASP.NET General, Design and Development.
-
Chris Leffer #1
Regular expression for punctuation
Hi.
I am trying to define a regular expression that accepts letters and
punctuation characters. I read something about Posix where I could use
[:punct:] in order to accept all the punctuation characters, but I could
not find how to add this to my expression. My expression is a simple
[A-Za-z]. How can I make it accept all the punctuation characters also?
Regards,
Chris Leffer
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Chris Leffer Guest
-
Regular expression help
Hi, I'm pretty new to regular expressions. Before, I used to write long-winded and buggy segments of code with PHPs string functions to extract... -
help on regular expression
Hi, I need some help on regular expression... i have following in variable $total_count $total_count = "##I USBP 000001 10:38:09(000)... -
regular expression help..
On Thu, 28 Aug 2003 15:50:49 +0200 "point" <point@caanNOSPAMproduction.com> wrote: Don't cross post, it's considered bad form. /^-+$/ ... -
help with regular expression
$text =~ /ABA.+ABA|ABA.+000/; $found = $&; -- Posted via http://dbforums.com -
Regular Expression....?
Hi I am looking for the regular expression for validating the allowed file types to upload like files like "zip,pdf,doc,rtf,gif,jpg,png,txt"; and... -
Chris R. Timmons #2
Re: Regular expression for punctuation
Chris Leffer <anonymous@devdex.com> wrote in
news:uIEpkDkRDHA.2240@TK2MSFTNGP11.phx.gbl:
Chris,> Hi Chris,
>
> I looked at the site. Very good information, thanks.
>
> But I tried to use the \p in my expression and it did not work.
> I finished the following expression that I use with a regular
> expression validator control:
>
> [A-Za-zÀ-ú0-9 \p{Po}]*
>
> I need to accept letters, accented letters, digits, spaces and
> punctuation characters. If I type any kind of character as < or> wrong with this expression?> > for example, all of them are accepted. Can you see what is
The * quantifier on the end means "zero or more". The short answer
is to use the + quantifier (one or more) instead.
The long answer is that the * quantifier can sometimes cause strange
problems because it always matches. When using your regex in a
operation to replace the > characters in string a>b>c with an x, I
received an incorrect result of xx>xx>xx. Changing the * to a +
caused the replacement regex to operate correctly and return a value
of x>x>x.
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
[url]http://www.crtimmonsinc.com/[/url]
Chris R. Timmons Guest



Reply With Quote

