I want to give users a text area where they can enter text. Later I will match that input against a different input and extract it if matched.
Flow:
- User enters text with returns into a text area
- Text is saved in the db in a text field
Then I use the following to extract:
text_reply = text_reply.sub(/#{user.text_to_extract}/m, '').strip
Problem is that it appears that characters like new lines or pipes | are breaking it. As input that we want to match against can look like this:
XXXXXX
XXXXXX
XXXX & XXXXX
asdasd: 123312321 | dasasddsadasads
http://yahoo.com
Suggestions? Thansk