This is my first experience with pattern matching using regular expressions so any help is appreciated.
I am trying to search a string for the following substrings:
"(TPU 1-999)
http://somewebaddress.com"
I want to keep TPU, 1-999 and the link as separate substrings.
This is the pattern I am using:
^\s{3}\(([AEINPRSTUW]{3})\s(\d{1,3}.\d{2,5})\)$^\s{3}(http+\s{1,100})$
I'll break it down to explain my reasoning
^\s{3} - beginning of string (or line in this case), followed by 3 spaces
\( - left parentheses
([AEINPRSTUW]{3}) - 3 instances of any of the letters in brackets, TPU being one example
\s(\d{1,3}.\d{2,5}) - a space and then 1-3 numeric digits, separated by any char from 2-5 more numeric digits
\)$ - right parentheses, end of line
^\s{3} - beginning of next line followed by three spaces
(http+\s{1,100})$ - the characters "http" followed by anywhere between 1 and 100 non whitespace characters, and the end of the line.
This pattern doesn't work right now but am I headed in the right direction?
"actually part of your string? And where are those three spaces you are trying to match?