Author Topic: Regular Expression  (Read 3377 times)

jukkap

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Regular Expression
« on: September 14, 2009, 08:08:15 AM »
Hi,

I am using VSE 6.0 on XP-station ServPack 3.0

My problem several big files (>10.000 lines/file). Files should include digit after field CardSerialNumber. See below.
But there is somehow also alpha- specialcharacters. How can I pick them out?

Using Search/Find: CardSerialNumber=(.*[A-Z].*) I get alphachars.
I tried to use  Search/Find: CardSerialNumber=(.*[~0-9].*). But it doesn't work. Is there something wrong in form or is cr's  at the end of the line?
Or what?

Example lines:
box.001.card.001.CardSerialNumber=01012900555636
box.001.card.001.McdID=055250010005090E
box.001.card.002.CardSerialNumber=01012900555637
box.001.card.002.McdID=05525001000508C1
box.001.card.003.CardSerialNumber=01012900555638
box.001.card.003.McdID=0552500100050898
box.001.card.004.CardSerialNumber=01012900555639

Waiting for your rapid reply to solve this problem.
Thanks.
br, jukkap



Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Regular Expression
« Reply #1 on: September 14, 2009, 01:15:29 PM »
Quote
Files should include digit after field CardSerialNumber. See below.

I don't understand what you're trying to do.  Can you explain any more clearly or give an example?
e.g.
box.001.card.001.CardSerialNumber=01012900555636
should become
box.001.card.001.CardSerialNumber1=01012900555636

or what?

Also, VSE 6.0 is fairly old so it would probably help if you posted the contents of your help file on regular expressions.  In slick 14, none of the available reg expressions allow .* to find zero or more of any character as well as [~ as not matching char set so it's likely that regular expression processing has changed since VSE 6.

Graeme

jukkap

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Regular Expression
« Reply #2 on: September 15, 2009, 07:54:01 AM »
Sorry for my unfocused explain. But:

I have a file including textfield  "CardSerialNumber=".
And after that there should be 14 digits (0-9).
But now there is randomly alpha- and specialcharacters, which  I like to find.
How?
Search/Find: CardSerialNumber=(.*[A-Z].*) works but how do I find specialcharacters like !"#¤%&/()...

jukkap,



Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Regular Expression
« Reply #3 on: September 15, 2009, 11:12:48 AM »
What kind of regular expressions are you using?  Slickedit, brief or unix?

Using slickedit regex you can do this

CardSerialNumber=~([0-9]:14)

which matches any CardSerialNumber= that is NOT followed by exactly 14 digits.

Graeme