culloden Posted August 16, 2010 Share Posted August 16, 2010 Hi folks,I would be grateful if someone could help me out here. I am working on a script to extract some info from text files and I wish to extract digits preceding the keyword as part of the match. The key word will always be the same but the number of digits will vary - there could be between 1 and 6 digits. For example - the keyword would be "folio" and could be preceded by a group of numbers in no particular order such as 3, 52, 712, 3834, 42195 or 863518. I want to extract the word "folio" and whatever numbers precede it. I seem to recall doing this before in VBScript with RegEx using \d+ and (?<= but I can't find that script or work out what the RegEx expression should be. For this I would prefer to use RegEx rather than InstrAll I want is the expression but any tips would be welcome and appreciatedTIA Link to comment Share on other sites More sharing options...
culloden Posted August 16, 2010 Author Share Posted August 16, 2010 Hi, I've worked it out as below:(?<\folio\d+)Thanks everyone Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.