×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Using Wildcards in Rules

Using Wildcards in Rules

Using Wildcards in Rules

(OP)
If I want to use a wildcard in a rule, such as :

If PartName==*bolt* Then

How would I do that?

Does it use regular expressions?

RE: Using Wildcards in Rules

The wildcard * will not work as it is a valid string character. You can create a reaction to do what you ask.

You need to create a String Parameter String.1 and a Boolean parameter Boolean.1
Create a reaction to fire on ValueChange of String.1

let Name (string)
let Name_len (integer)
let Item (string)
let Result (string)
let Item_len (integer)
let len_diff (integer)
let i (integer)

/* Output */
Boolean.1 = false

/* Assignment */

Name = String.1
Name_len = Name->Length()
Item = "bolt"
Item_len = Item->Length()
len_diff = Name_len - Item_len + 1
i = 0

if Name_len >= Item_len
{
for i while i < len_diff
{
Result = Name->Extract(i,Item_len)
if Result == Item
Boolean.1 = true
i = i + 1
}

}




Regards,
Derek


Win XP64
R20/21, 3DVIA Composer 2012, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources