Source language: Translate to:

Special Characters for Regex

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Special Characters for Regex

Postby asawyer13 » Thu Oct 13, 2011 4:07 pm

I am trying to set up a string that I'm going to use for a Regex.

The string is
^(("(?:[^"]|"")*"|[^,]*)(,("(?:[^"]|"")*"|[^,]*))*)$

I have used the Special Characters for [, ], |, and " but the RegEx is still complaining so I suspect I need to do a special character for another character.

This is what I have after doing the replacements.
^(([#34](?:[#91]^[#34][#93][#124][#34][#34])*[#34][#124][#91]^,[#93]*)(,([#34](?:[#91]^[#34][#93][#124][#34][#34])*[#34][#124][#91]^,[#93]*))*)$

Could it be the parenthesis??

Alan
asawyer13
 
Posts: 123
Joined: Sun Aug 22, 2010 6:13 pm

Postby dec » Thu Oct 13, 2011 5:22 pm

Hi,

I fact I get crazy about this kind of issues, because finally you can get a very large and unafordable string. Because I dont know (right now) how to deal with this, I adopt a form to use regular expresions: using a text entry object text.

So you can (at least for test pourposes) put the regular expresion "as is" on a text entry object, and then use the text entry object variable. So you not need to replace anything, because you get the raw regular expresion from the text entry variable.

Maybe another mate can put us on a better way to achieve this. :)

P.S. For the other hand I recommend you RegExp Studio in order to try the regular expresions.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Thu Oct 13, 2011 10:39 pm

Hello,

I tried your replaced string with setvar and get exactly the string you show above.
You may add the ! in front of the string.
For me it does nothing change, but maybe some processing based on locale setting is avoided.
The variable shows also the exact same content in the debugger like I set in a textentry.

For regex editing I use http://www.regexbuddy.com/ shareware.
In my regex commands in hpwControl I used a direkt link to that editor to allow editing there and send back to the neobook wizard.
Hans-Peter
User avatar
HPW
 
Posts: 2521
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest