Capturing a string until the first carriage character appears in the regex?
I am working with legacy systems at the moment and most of the work is related to decomposing delimited strings and validating certain rules.
With this line, how can I return "Active" in the backlink and search terms, stopping when it hits the first caret (^):
Active^20080505^900^LT^100
Can this be done by including this " (.+)
" in the regular expression ? The reason I am asking is because the actual regex is " (.+)
" defined in the database as cutting these messages and their associated rules can be set from an external system. In this case, the content can be anything ("Active"), so in this case ". +" Is used.
Rule. The carriage character cannot be enclosed between parentheses, as this could result in it being stored in a database field and defined elsewhere in a different system field.
If you have a better offer than " (.+)
", he'll be glad to hear it.
Thanks in advance.
source to share