Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 regex little question pls

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-10 : 13:18:23
If I have a regex like this:
Regex objAlphaNumericPattern = new Regex(">[ ]*[\\s]*[a-zA-Z0-9\x0600-\x06ff\x00DF]+[ ]*<");

and I want to include these 2 characters also to be take into consideration [ and ]

How do I specify them inside my regex
Thanks

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-01-10 : 14:07:10
\[ and \]
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-10 : 19:14:42
cool snSQL i ll try thhat

tell me pls:
What does it mean when we put \x06ff
or \x00DF does \x00 refer to some thing ? i just don t understand this notation
Thank you
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-10 : 19:18:43
also for what caracters should we necessary put the escape \ like we did for [ and ]
Thanks
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-11 : 03:39:39
If you are going to be using a complex RegEx like that I reckon you need to read up so that you can understand it and make sure that it is fit-for-purpose.

You scare me asking questions about how to add more character enclosures and then say that you don't understand what the individual bits do

Kristen
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-11 : 16:38:57
it s a maintenance task. The regex is already there so i need to understand it in order to be able to maintain. Thanks Kristen for advising.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-12 : 01:18:11
"The regex is already there so i need to understand it in order to be able to maintain"

OK, but I reckon that "a little knowledge is a dangerous thing"! and I'm don't know the answer and can only make a guess:

"What does it mean when we put \x06ff"

It looks like a Hex notation for 06FF - but that's kinda large for a byte! Maybe its for Unicode 2-byte characters?

http://www.regular-expressions.info/ or http://www.regexlib.com may help

Kristen
Go to Top of Page
   

- Advertisement -