B
Brent
I'm trying to write a regex to find this pattern
1. A 6-10 character "word" having at least one number (0-9) in any
position. It will have a space on its right side, but may have any
character on the left. In addition, when the word is nine characters --
the usual case -- it may be formatted as follows: "AAAAAA AA A".
2. White space of some length.
3. A number of some length, or the world "CALL" or "PUT".
4. White space of some length.
5. A number of some length that may have any character on its right
edge, though mostly white space.
The regex I've used so far gets about 80-90% of what I'm looking for.
The problem comes in making sure the 6-10 initial word contains at least
one number somewhere in its length. I don't know how to specify that.
I'm hoping for some fine tuning from smarter guys than I! Here is my
current expression broken out:
1. (?<CUSIP>\w\d{2}\w{6}\s|\d\w{5-10}\s|\w{6}\s\w{2}\s\w\s)
2. (\s*?)
3. (?<Value>\b\d+\b|CALL|PUT)
4. (\s*?)
5. (?<Shs_prn_amt>\b\d+)(.*?)
Many thanks for any help!
--Brent
1. A 6-10 character "word" having at least one number (0-9) in any
position. It will have a space on its right side, but may have any
character on the left. In addition, when the word is nine characters --
the usual case -- it may be formatted as follows: "AAAAAA AA A".
2. White space of some length.
3. A number of some length, or the world "CALL" or "PUT".
4. White space of some length.
5. A number of some length that may have any character on its right
edge, though mostly white space.
The regex I've used so far gets about 80-90% of what I'm looking for.
The problem comes in making sure the 6-10 initial word contains at least
one number somewhere in its length. I don't know how to specify that.
I'm hoping for some fine tuning from smarter guys than I! Here is my
current expression broken out:
1. (?<CUSIP>\w\d{2}\w{6}\s|\d\w{5-10}\s|\w{6}\s\w{2}\s\w\s)
2. (\s*?)
3. (?<Value>\b\d+\b|CALL|PUT)
4. (\s*?)
5. (?<Shs_prn_amt>\b\d+)(.*?)
Many thanks for any help!
--Brent