• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to Use Regex Options in CS2 [JS] - Reg.

New Here ,
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

Dear All,

Hai, I have doubt about the Regex options using in CS2 - Script.

Problem :

filename = "FTR0123a.indd";

k = Regex.match(filename,"(^FTR)(\d+)([A-Z*])\.(indd|indt))

if k.match = success

k1 = "."
k2 = $1 [ Stored in First Value only]
k3 = $2 [ Stored in Second Value only]

Here I got the answers from VB.NET using Regex options. But I can't use the Same condition in Javascript.

Please any one can give the solutions about the problem.

Thanks & Regards
T.R.Harihara SudhaN
TOPICS
Scripting

Views

393

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2008 Jan 11, 2008

Copy link to clipboard

Copied

The correct format is

filename = "FTR0123a.indd";
k = filename.match (/^(FTR)(\d+)([A-Za-z]*)\.(indd|indt)/);

This gives a five-element array, which you can see when you try this in the ESTK.

Peter

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2008 Mar 03, 2008

Copy link to clipboard

Copied

LATEST
Dear Peter

many thanks for this responce.

Yah!. Its working fine.

Thanks & Regards
T.R.Harihara SudhaN

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines