• Advertisement
Sign in to follow this  

Looking for a string policy search API

This topic is 1519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement