Solved

Need a regular expression for workflow id from an incremental file

Posted on 2013-05-14
5
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need some help with grep 7 102
Removing text between BBCODE tags in Excel 3 86
Problem of RegEx to match the first occurence of 10 63
Reg Exp to extract Url from string asp 12 39
by Batuhan Cetin Regular expression is a language that we use to edit a string or retrieve sub-strings that meets specific rules from a text. A regular expression can be applied to a set of string variables. There are many RegEx engines for u…
Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
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…

726 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