Jump to content

  • Log In with Google      Sign In   
  • Create Account

Looking for a string policy search API


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Ziel   Members   -  Reputation: 126

Like
0Likes
Like

Posted 19 November 2013 - 02:01 PM

I'm looking for an API that would allow you to search strings for certain policies. For example, I would want to return strings that have a number pattern of a social security number, xxx-xx-xxxx, or maybe just a keyword(s) search. It would be nice to combine multiple policy searches into one search. Does an API like this exist out there free or paid? Preferably in C#? And if not, could you recommend where I should start looking to implement something like this myself?

 

Thanks!



Sponsor:

#2 ChaosEngine   Crossbones+   -  Reputation: 2363

Like
4Likes
Like

Posted 19 November 2013 - 02:09 PM

The most flexible way to do this would probably be a regular expression (aka regex) and yes, there is a regex library for c#. In fact it's part of the .net framework

 

Annoyingly, the .net version uses a slightly different syntax to the old style regexs, which means you will have to understand and tweak many common existing regexs. You will easily find regexs for common patterns like social security numbers, etc


if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#3 Ziel   Members   -  Reputation: 126

Like
0Likes
Like

Posted 19 November 2013 - 02:23 PM

The most flexible way to do this would probably be a regular expression (aka regex) and yes, there is a regex library for c#. In fact it's part of the .net framework

 

Annoyingly, the .net version uses a slightly different syntax to the old style regexs, which means you will have to understand and tweak many common existing regexs. You will easily find regexs for common patterns like social security numbers, etc

 

That's what I figured I'd have to use. I was put off from them because I had to use one in another project I worked on and I had no idea exactly how it worked. I guess I'll have to take the time to learn about them. Thanks!



#4 ChaosEngine   Crossbones+   -  Reputation: 2363

Like
0Likes
Like

Posted 19 November 2013 - 04:58 PM

That's what I figured I'd have to use. I was put off from them because I had to use one in another project I worked on and I had no idea exactly how it worked. I guess I'll have to take the time to learn about them. Thanks!

 
TBF, they can be a pain in the ass. There's a saying about people who, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems. :D

 

But they are an incredibly useful tool for the kind of work you're describing.


if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#5 Paradigm Shifter   Crossbones+   -  Reputation: 5374

Like
0Likes
Like

Posted 19 November 2013 - 05:13 PM

Yeah, my order of operations would be grep/sscanf/regex in that order. sscanf probably not very useful if you didn't write the data yourself.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#6 Anthony Serrano   Members   -  Reputation: 1192

Like
0Likes
Like

Posted 20 November 2013 - 11:00 PM

That's what I figured I'd have to use. I was put off from them because I had to use one in another project I worked on and I had no idea exactly how it worked. I guess I'll have to take the time to learn about them. Thanks!

 
TBF, they can be a pain in the ass. There's a saying about people who, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems. biggrin.png
 
But they are an incredibly useful tool for the kind of work you're describing.


Yup. Regular expressions are powerful and important to understand, but it's just as important to understand when NOT to use them.

Too many people see them as a cure-all solution for parsing-related problems, completely ignorant to the fact that regular expressions and the grammars they define are the simplest form of grammar (functionally equivalent to finite state machines), and thus there are many problems for which they are only a partial solution at best (such as parsing natural languages).

For example, they're great for extracting social security numbers or phone numbers from text, and decent (if extremely complex) at validating e-mail addresses, but totally incapable of validating C code.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS