Skip to main content
Participant
Oct 13, 2023 12:22 PM UTC
Question

Can someone help with classification regex value

Can someone help with classification regex value for the below :

 

year|2023,model|tundra,trim level|limited crew max,driveline|4x4 i-force v6 10at

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

CarlosCanto
Community Expert
Community Expert
Oct 16, 2023 7:04 PM UTC

can you elaborate? what do you mean by Help with classification?

Translate
Participant
Oct 17, 2023 5:16 AM UTC

Hi CarlosCanto,

This is the existing value -> year|2023,model|tundra,trim level|limited crew max,driveline|4x4 i-force v6 10at
and what we need regex is to classify the above value.

Example:

Year-
2023
model
tundra
trimlevel
limited
crew max
driveline
4x4 i
force
v6
10at

All that we need is the regex value.

Thanks for you help.

Translate
CarlosCanto
Community Expert
Community Expert
Oct 17, 2023 7:29 AM UTC

 

var str = "year|2023,model|tundra,trim level|limited crew max,driveline|4x4 i-force v6 10at";

var re = /[|,]/;

var arr = str.split (re);

alert(arr.join("\n"));

 

year
2023
model
tundra
trim level
limited crew max
driveline
4x4 i-force v6 10at
Result: undefined

 

Translate