Welcome Guest Search | Active Topics | Members | Log In | Register

Regular expression examples Options · View
Bryant Biorn
Posted: Thursday, October 15, 2009 11:20:51 AM
Rank: Administration

Joined: 2/13/2008
Posts: 6
Location: Idaho Falls, ID
Example 1: Extracts a date value from a multi-value string. ie. (B,W,1/12/2003, AD13447-TX) Considers double and single digit months and days, always expects 4 digit year.(single step process)

Step 1: (\d\d\/\d\d\/\d\d\d\d)|(\d\d\/\d\/\d\d\d\d)|(\d\/\d\d\/\d\d\d\d)|(\d\/\d\/\d\d\d\d) - Find first

Example 2: get the Month from a date value and pad the single digit months with a zero ie. 8=08 etc.(4 step process)

step 1: (\d\/)|(\d\d\/) - Find First
step 2: (\d\/)|(\d\d\/) - Replace First -0$1$2
step 3: (\d\d\/) - Find First
step 4: \d\d - Find All
Bryant Biorn
Posted: Wednesday, March 17, 2010 10:35:12 AM
Rank: Administration

Joined: 2/13/2008
Posts: 6
Location: Idaho Falls, ID
With Version 2.1.045 release and support for Window Title bar capture, you might need to locate a specific item in the string. This regular expression example finds ID: and creates a token from the ID number.

(?:ID: )(d/d/d/d)
schromik
Posted: Tuesday, March 30, 2010 11:11:16 AM
Rank: Newbie

Joined: 2/16/2009
Posts: 1
Location: Tallahassee, FL
Do ya'll have any advice for going about creating a folder structure for use in a Building department? Their current structure is organized by address, and is as follows:

Building Master Report
-A's
--Adams
---900
----901
-----Doc1
-----Doc2
-----Doc3
-----Doc4

Bryant Biorn
Posted: Tuesday, March 30, 2010 11:33:52 AM
Rank: Administration

Joined: 2/13/2008
Posts: 6
Location: Idaho Falls, ID
For this example I'll assume that you can capture the data "Adams" and the data "901" using normal methods.
You should create multiple tokens for each and apply regular expression to format the data as required.
Token Name: Name_Folder; "Adams" becomes "Adams" no regular expression needed.
Token Name: Alpha_Folder; "Adams" becomes "A" using the regular expression (User Defined) \D Find First.
Token Name: Unit_Folder; "901" becomes "901" no regular expression needed.
Token Name: Unit_Prefix_Folder; "901" becomes "90" using the regular expression (User defined) \d\d Find First.

Then the dynamic, Create sub-folder path becomes %(Alpha_Folder)\%(Name_Folder)\%(Unit_Prefix_Folder)0\%(Unit_Folder)

Although this may not be 100% correct depending on your situation, I hope it sheds some light on the techniques used to create tokens and the use of regular expression.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.237 seconds.