Jump to content

OT: [Resolved] help w/ Regular Expressions .net (interesting project here)


Recommended Posts

Posted (edited)

Hi,

 

I am hoping someone maybe able to help me with my latest MB project.

 

I have been researching the world of Text Mining. It is a scary world, where computers are able to read text and extract information.

 

Companies use this technology to read your twitter and facebook tweets and figure out information about you.

 

However, I am using it to remove excess information from movie descriptions. A Computer speaking sounds better when it says less, but it still has to get the point across, you see.

 

So far, i have been able to extract a great deal of information, however I have come to a cross roads and need to use RegExp.

 

I need to remove this line from my String:

 

 

(/NNP\n  (PERSON Sandra/NNP Bullock/NNP)\n  

 

Where the name "Sandra" and "Bullock" would have to be a wild card.

 

I have tried:


                    For Each match As Match In regex.Matches(paragraph, "(/NNP\n  (PERSON .*/NNP .*/NNP)\n")
                        paragraph = paragraph.Replace(match.Value, " ")
                    Next

However, because the line uses "/" i believe that they are used in Regex to mean something, and therefore causing the code to fail.

 

 

thanks again for any input.

 

Ben

Edited by chef
Posted

Well I got it

 

the answer is to use "\\" when there are "\" in the line of code you wish to find.

 

this little app is going to be really cool!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...