Link to home
Start Free TrialLog in
Avatar of tmajor99
tmajor99

asked on

Regular Expression to find a string

I need a regular expression to find strings like this:  

ElectriFLEX LD(TM)
(RR) Flex Seal
Avatar of arnold
arnold
Flag of United States of America image

(
(ElectriFLEX LD\(TM)\|\(RR\) Flex Seal)

Open in new window


The examples are too narrow if there are different.modification.

Regex applications differe in context/implementation of a ...
ASKER CERTIFIED SOLUTION
Avatar of Juan Carlos
Juan Carlos
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It would be helpful to have some more examples, plus also some examples of strings that you *don't* want to match.
Remember that we're not in your head - you need to provide full explanations of what you're trying to do. Otherwise, it's like going into a store and asking a random clerk, "Do you have something that I can buy that will find things that I want, like this hat I'm wearing?" The clerk will likely give you a confused look because he doesn't know what you're looking for, aside from maybe that you want more hats. So that said, please provide some more detail. If you're not sure where to begin, answer these questions:

1. Where is the text you're trying to find? For example, is it in the middle of a Word document, or a text file, or inside an image file, or just a string in the middle of a program you're writing? In other words, what's AROUND the text you're looking for?

2. You said "string like these" and you gave two examples of strings that have very little in common except for the word "flex" in both of them, and they both have parentheses. You need to explain what makes both of them. For example, if I found "Superflex Glue", would it NOT be a match because it doesn't have parentheses? Or would ANY word longer than a certain number of letters be valid, like "Watermelon" ? Or is there a valid list of words to look for?

3. Like Terry asked, are there certain things that -shouldn't- be matched?