Help with Regex

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Scones
Newbie
Posts: 8
Joined: Fri Jul 05, 2019 11:21 am

Help with Regex

Post by Scones » Thu Nov 07, 2019 11:51 am

Hello

Can anyone figure this one out? Here is my string:

Esko ArtiosCAD - [TEST - 0 mfg]

This text is always the same
This text is always different
This is the text i need to get

I have never used regex before, so i'm very lost here.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 490
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Help with Regex

Post by Dorian (MJT support) » Thu Nov 07, 2019 1:06 pm

This regex returns "everything between"

Code: Select all

//To help you understand
let>mystring=Esko ArtiosCAD - [TEST - 0 mfg]
let>BEGINNING=0 
let>END=]
RegEx>(?<=%BEGINNING%).*?(?=%END%),mystring,0,matches,nm,0
MessageModal>%nm% matches %CRLF%The item number is %matches_1%

//All condensed into one line
RegEx>(?<=0 ).*?(?=]),Esko ArtiosCAD - [TEST - 0 mfg],0,matches,nm,0
MessageModal>%nm% matches %CRLF%The item number is %matches_1%
Always accepting custom script commissions. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 363
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Re: Help with Regex

Post by Grovkillen » Thu Nov 07, 2019 5:29 pm

A piece of advice, pay for regexBuddy
Let>ME=%Script%

Running: MS14.5.4

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 490
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Help with Regex

Post by Dorian (MJT support) » Mon Nov 11, 2019 12:01 pm

Grovkillen wrote:
Thu Nov 07, 2019 5:29 pm
A piece of advice, pay for regexBuddy
Also, here's a free Regex course. It helped me grasp a basic understanding.

https://www.udemy.com/course/regex-acad ... g-sorcery/
Always accepting custom script commissions. Message me or go here

Post Reply