Solved

Need a regular expression for workflow id from an incremental file

Posted on 2013-05-14
5
224 Views
Last Modified: 2013-05-15
i need a regular expression to get the workflow id from a file that increments.
need to isolate just the workflow id each time it is run.
thanks,

workflow id in this example is 40
<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/"><Result ID="1,New"><ErrorCode>0x00000000</ErrorCode><ID /><z:row ows_ContentTypeId="0x010021844C7573B1284CB4B97885C68484EA" ows_Title="StudentName" ows_LinkTitleNoMenu="StudentName" ows_LinkTitle="StudentName" ows_StudentID="StudentID" ows_Sex="Male" ows_DOB="5/15/2013" ows_Race="Alaska Native" ows_School="BOE" ows_Grade="3" ows_Teacher="Teacher" ows_StudentStreetAddress="StudentStreetAddress" ows_City="City" ows_State="State" ows_Zip="Zip" ows_TelephoneHome="TelephoneHome" ows_EmergencyPhone="EmergencyPhone" ows_Name_student_lives_with="Name_student_lives_with" ows_Relationship="Relationship" ows_parentguardianemployer="parentguardianemployer" ows_workphone="workphone" ows_ReasonforReferral="ReasonforReferral" ows_Initiator="INSTRUCTIONAL\douwin01" ows_SocialWorker="INSTRUCTIONAL\workflowtesting1" ows_principal="INSTRUCTIONAL\workflowtesting2" ows_ID="40" ows_ContentType="Item" ows_Modified="2013-05-14 15:58:50" ows_Created="2013-05-14 15:58:50" ows_Author="1593;#SCCPS-ACORN\workflowuser" ows_Editor="1593;#SCCPS-ACORN\workflowuser" ows_owshiddenversion="1" ows_WorkflowVersion="1" ows__UIVersion="512" ows__UIVersionString="1.0" ows_Attachments="0" ows__ModerationStatus="0" ows_SelectTitle="40" ows_Order="4000.00000000000" ows_GUID="{BEA32F6C-E29D-4CA1-AF37-BEC579423121}" ows_FileRef="40;#SS/swr/RP/Lists/Referral Processing/40_.000" ows_FileDirRef="40;#SS/swr/RP/Lists/Referral Processing" ows_Last_x0020_Modified="40;#2013-05-14 15:58:50" ows_Created_x0020_Date="40;#2013-05-14 15:58:50" ows_FSObjType="40;#0" ows_PermMask="0x7fffffffffffffff" ows_FileLeafRef="40;#40_.000" ows_UniqueId="40;#{0F0919AC-1CB8-4AC0-A1CA-85F0BC8DDA9B}" ows_ProgId="40;#" ows_ScopeId="40;#{6445C5BC-414E-4FB4-B828-9B9B55EE3871}" ows__EditMenuTableStart="40_.000" ows__EditMenuTableEnd="40" ows_LinkFilenameNoMenu="40_.000" ows_LinkFilename="40_.000" ows_ServerUrl="/SS/swr/RP/Lists/Referral Processing/40_.000" ows_EncodedAbsUrl="http://sccps-acorn/SS/swr/RP/Lists/Referral%20Processing/40_.000" ows_BaseName="40_" ows_MetaInfo="40;#" ows__Level="1" ows__IsCurrentVersion="1" xmlns:z="#RowsetSchema" /></Result></Results>

workflow id in this example is 39
<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/"><Result ID="1,New"><ErrorCode>0x00000000</ErrorCode><ID /><z:row ows_ContentTypeId="0x010021844C7573B1284CB4B97885C68484EA" ows_Title="StudentName" ows_LinkTitleNoMenu="StudentName" ows_LinkTitle="StudentName" ows_StudentID="StudentID" ows_Sex="Male" ows_DOB="5/15/2013" ows_Race="Alaska Native" ows_School="BOE" ows_Grade="3" ows_Teacher="Teacher" ows_StudentStreetAddress="StudentStreetAddress" ows_City="City" ows_State="State" ows_Zip="Zip" ows_TelephoneHome="TelephoneHome" ows_EmergencyPhone="EmergencyPhone" ows_Name_student_lives_with="Name_student_lives_with" ows_Relationship="Relationship" ows_parentguardianemployer="parentguardianemployer" ows_workphone="workphone" ows_ReasonforReferral="ReasonforReferral" ows_Initiator="INSTRUCTIONAL\douwin01" ows_SocialWorker="INSTRUCTIONAL\workflowtesting1" ows_principal="INSTRUCTIONAL\workflowtesting2" ows_ID="39" ows_ContentType="Item" ows_Modified="2013-05-14 15:55:02" ows_Created="2013-05-14 15:55:02" ows_Author="1593;#SCCPS-ACORN\workflowuser" ows_Editor="1593;#SCCPS-ACORN\workflowuser" ows_owshiddenversion="1" ows_WorkflowVersion="1" ows__UIVersion="512" ows__UIVersionString="1.0" ows_Attachments="0" ows__ModerationStatus="0" ows_SelectTitle="39" ows_Order="3900.00000000000" ows_GUID="{D02A1A5F-253E-4580-9711-69298D0857C8}" ows_FileRef="39;#SS/swr/RP/Lists/Referral Processing/39_.000" ows_FileDirRef="39;#SS/swr/RP/Lists/Referral Processing" ows_Last_x0020_Modified="39;#2013-05-14 15:55:02" ows_Created_x0020_Date="39;#2013-05-14 15:55:02" ows_FSObjType="39;#0" ows_PermMask="0x7fffffffffffffff" ows_FileLeafRef="39;#39_.000" ows_UniqueId="39;#{58318C1F-BD91-4F84-BDF9-A1F8712B3FB8}" ows_ProgId="39;#" ows_ScopeId="39;#{6445C5BC-414E-4FB4-B828-9B9B55EE3871}" ows__EditMenuTableStart="39_.000" ows__EditMenuTableEnd="39" ows_LinkFilenameNoMenu="39_.000" ows_LinkFilename="39_.000" ows_ServerUrl="/SS/swr/RP/Lists/Referral Processing/39_.000" ows_EncodedAbsUrl="http://sccps-acorn/SS/swr/RP/Lists/Referral%20Processing/39_.000" ows_BaseName="39_" ows_MetaInfo="39;#" ows__Level="1" ows__IsCurrentVersion="1" xmlns:z="#RowsetSchema" /></Result></Results>

workflow id in this example is 38
<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/"><Result ID="1,New"><ErrorCode>0x00000000</ErrorCode><ID /><z:row ows_ContentTypeId="0x010021844C7573B1284CB4B97885C68484EA" ows_Title="StudentName" ows_LinkTitleNoMenu="StudentName" ows_LinkTitle="StudentName" ows_StudentID="StudentID" ows_Sex="Male" ows_DOB="5/15/2013" ows_Race="Alaska Native" ows_School="BOE" ows_Grade="3" ows_Teacher="Teacher" ows_StudentStreetAddress="StudentStreetAddress" ows_City="City" ows_State="State" ows_Zip="Zip" ows_TelephoneHome="TelephoneHome" ows_EmergencyPhone="EmergencyPhone" ows_Name_student_lives_with="Name_student_lives_with" ows_Relationship="Relationship" ows_parentguardianemployer="parentguardianemployer" ows_workphone="workphone" ows_ReasonforReferral="ReasonforReferral" ows_Initiator="INSTRUCTIONAL\douwin01" ows_SocialWorker="INSTRUCTIONAL\workflowtesting1" ows_principal="INSTRUCTIONAL\workflowtesting2" ows_ID="38" ows_ContentType="Item" ows_Modified="2013-05-14 15:06:53" ows_Created="2013-05-14 15:06:53" ows_Author="1593;#SCCPS-ACORN\workflowuser" ows_Editor="1593;#SCCPS-ACORN\workflowuser" ows_owshiddenversion="1" ows_WorkflowVersion="1" ows__UIVersion="512" ows__UIVersionString="1.0" ows_Attachments="0" ows__ModerationStatus="0" ows_SelectTitle="38" ows_Order="3800.00000000000" ows_GUID="{01DEDEC0-E8D0-4C77-A742-50E8A27F7010}" ows_FileRef="38;#SS/swr/RP/Lists/Referral Processing/38_.000" ows_FileDirRef="38;#SS/swr/RP/Lists/Referral Processing" ows_Last_x0020_Modified="38;#2013-05-14 15:06:53" ows_Created_x0020_Date="38;#2013-05-14 15:06:53" ows_FSObjType="38;#0" ows_PermMask="0x7fffffffffffffff" ows_FileLeafRef="38;#38_.000" ows_UniqueId="38;#{124846A1-DA05-4BC7-B980-9CCDB967A61D}" ows_ProgId="38;#" ows_ScopeId="38;#{6445C5BC-414E-4FB4-B828-9B9B55EE3871}" ows__EditMenuTableStart="38_.000" ows__EditMenuTableEnd="38" ows_LinkFilenameNoMenu="38_.000" ows_LinkFilename="38_.000" ows_ServerUrl="/SS/swr/RP/Lists/Referral Processing/38_.000" ows_EncodedAbsUrl="http://sccps-acorn/SS/swr/RP/Lists/Referral%20Processing/38_.000" ows_BaseName="38_" ows_MetaInfo="38;#" ows__Level="1" ows__IsCurrentVersion="1" xmlns:z="#RowsetSchema" /></Result></Results>
0
Comment
Question by:metatonka
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39166431
For what language or text editor? You might try:

ows_ID="([0-9]+)

Open in new window


...and inspect group 1.
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39166809
Sharepoint?

ows_ID="(\d+)"

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39166956
@Mazdajai

Seriously, how is your pattern different than what I suggested?
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39166991
Didn't realize your solution it until I posted mine . . .
0
 

Author Comment

by:metatonka
ID: 39168930
after using ows_ID="([0-9]+) on the the example above
i extracted the following result  "ows_ID="63;"
then i did a regularexpress replace with ";"
and got the number 63.

Had to two step it.
Using a regular expression withing nintex 2007 workflow manager with sharepoint.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Basic Regex for use in webservice 1 64
Understanding a RegEx for C# 2 47
Php - Replacement of words in an string 3 40
Regex code,how to do this? 3 39
I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question