Skip to main content
Participant
October 13, 2023
Question

Can someone help with classification regex value

  • October 13, 2023
  • 1 reply
  • 287 views

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 has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
October 16, 2023

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

Participant
October 17, 2023

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.

CarlosCanto
Community Expert
Community Expert
October 17, 2023

 

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