正则表达式亲 [英] regex pro

查看:32
本文介绍了正则表达式亲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是交易... cvs,tick封装数据。试图使用正则表达式来验证记录。这是一个示例行:


''AD,''BF'',''132465'',''06/09/2004'','''' ,''BNSF'',''A'',''TYPE'',''1278'','''',''BR'',''2999'',''''

,''LX'','''',''01'',''09'',''''',''''''''''''''''' ''','''',''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第8栏(''1278'')。使用正则表达式b / c有一个

miriad类型导致其他数据没有记录(或相关记录)

是/有效的。我在前7列的概括中获得了匹配的问题:


这样的事情:


(?=(?:(?<!'','')。*(?!='','')'','')){7}(?:''1278( ?='',''))


(?=(?:(?<!'','')。*(?!='','') '','')){7}表示前7个列。


如果有人可以帮助我概括那个模式,我会非常感激。


tia,

史蒂夫

here''s the deal...cvs, tick encapsulted data. trying to use regex''s to
validate records. here''s an example row:

''AD,''BF'',''132465'',''06/09/2004'','''',''BNSF'',''A'',''TYPE'',''1278'','''',''BR'',''2999'','' ''
,''LX'','''',''01'',''09'',''1'','''','''','''','''','''','''','''','''',''CU STOM JOB CODE TEST''

record type is in the 8th column (''1278''). using regex b/c there are a
miriad of types that cause other data w/n the record (or related records) to
be in/valid. i''m having problems getting a match on the generalization of
the first 7 columns:

something like this:

(?=(?:(?<!'','').*(?!='','')'','')){7}(?:''1278(?='',''))

(?=(?:(?<!'','').*(?!='','')'','')){7} represents the first 7 colums.

if someone can help me generalize that patter, i''d appreciate it very much.

tia,

steve

推荐答案

好事我发布了解释问题......让我直接进入

解决方案。记录类型在第7列!!!


(?=(?:(?<!'','')。*(?!='','') '', '')){8}( ''((12((7- [89])|(8 [0-7])|(9 [0-468])))|(13((0 [

0-3])|(1 [16])|(2 [0135])))| 1612)'')


感谢您寻找虽然...如果你这样做了。


; ^)


" steve" < a@b.com>在消息中写道

新闻:10 ************* @ corp.supernews.com ...

|这是交易... cvs,tick封装数据。试图使用正则表达式来支付
|验证记录。这是一个示例行:

|

|

''AD,''BF'',''132465'', ''06 / 09/2004', '' '', '' BNSF '', '' A '', '' TYPE '', '' 1278 '', '' '', '' BR', ''2999'',''''

| '' LX '', '' '', '' 01 '', '' 09 '', '' 1 '', '' '', '' '', '' '', '' '', '''''''''''''''''''''''''''''''''''''''''''''''''''''$ $ $ $ $记录类型位于第8列(''1278'')。使用正则表达式b / c有一个

|导致其他数据没有记录的类型的miriad(或相关记录)

to

|在/有效。我在获得关于

|的概括的匹配时遇到了问题前7列:

|

|这样的事情:

|

| (????=(:(小于 '', '')*(= '', '') '', '')!。?!){7}(?: '' 1278(=? '' ,'')

|

| (?=(?:(?<!'','')。*(?!='','')'','')){7}表示前7个列。

|

|如果有人可以帮助我概括那种模式,我会非常感激

很多。

|

| tia,

|

|史蒂夫

|

|
good thing i posted the explaination of the problem...lead me right to the
solution. record type is in column 7!!!

(?=(?:(?<!'','').*(?!='','')'','')){8}(''((12((7[89])|(8[0-7])|(9[0-468])))|(13((0[
0-3])|(1[16])|(2[0135])))|1612)'')

thanks for looking though...if you did.

;^)

"steve" <a@b.com> wrote in message
news:10*************@corp.supernews.com...
| here''s the deal...cvs, tick encapsulted data. trying to use regex''s to
| validate records. here''s an example row:
|
|
''AD,''BF'',''132465'',''06/09/2004'','''',''BNSF'',''A'',''TYPE'',''1278'','''',''BR'',''2999'','' ''
| ,''LX'','''',''01'',''09'',''1'','''','''','''','''','''','''','''','''',''CU STOM JOB CODE TEST''
|
| record type is in the 8th column (''1278''). using regex b/c there are a
| miriad of types that cause other data w/n the record (or related records)
to
| be in/valid. i''m having problems getting a match on the generalization of
| the first 7 columns:
|
| something like this:
|
| (?=(?:(?<!'','').*(?!='','')'','')){7}(?:''1278(?='',''))
|
| (?=(?:(?<!'','').*(?!='','')'','')){7} represents the first 7 colums.
|
| if someone can help me generalize that patter, i''d appreciate it very
much.
|
| tia,
|
| steve
|
|





正则表达式测试员。
http://royo.is-a -geek.com/iserializable/regulator/


Ken

----------------


" steve" < a@b.com>在留言中写道

新闻:10 ************* @ corp.supernews.com:
Hi,

Regular expression tester.
http://royo.is-a-geek.com/iserializable/regulator/

Ken
----------------

"steve" <a@b.com> wrote in message
news:10*************@corp.supernews.com:
好事我发布了解释问题......引导我走向

解决方案。记录类型在第7列!!!

(?=(?:(?<!'','')。*(?!='','')'',' '){8}(''((12((7 [89])|(8 [0-7])|(9 [0-468])))|(13 [(0 [/ 0]
0-3])|(1 [16])|(2 [0135])))| 1612)'')

感谢您寻找......如果您这样做了。

; ^)

史蒂夫 < HYPERLINK" mailto:a@b.com" a@b.com>在消息中写道
新闻:10 ************* @ corp.supernews.com ...
|这是交易... cvs,tick封装数据。试图使用正则表达式来

|验证记录。这是一个示例行:
|
|

''AD','BF'',''132465'',''06/09/2004' , '' '', '' BNSF '', '' A '', '' TYPE '', '' 1278', '' '' '' BR '', '' 2999', '' ''

| '' LX '', '' '', '' 01 '', '' 09 '', '' 1 '', '' '', '' '', '' '', '' '', ''''',''''''''''''''''''''''''''''''''''''''''''''''''''''记录类型位于第8列(''1278'')。使用正则表达式b / c有一个

|导致其他数据没有记录的类型的miriad(或相关的
记录)

|在/有效。我在获得关于
的概括性问题时遇到了问题前7列:
|
|这样的事情:
|
| (????=(:(小于 '', '')*(= '', '') '', '')!。?!){7}(?: '' 1278(=? '' ,''))
|
| (?=(?:(?<!'','')。*(?!='','')'','')){7}代表前7个列。
|
|如果有人可以帮助我概括那种模式,我会非常感激。
|
| tia,
|
|史蒂夫
|
|
good thing i posted the explaination of the problem...lead me right to the

solution. record type is in column 7!!!
(?=(?:(?<!'','').*(?!='','')'','')){8}(''((12((7[89])|(8[0-7])|(9[0-468])))|(13((0[

0-3])|(1[16])|(2[0135])))|1612)'')

thanks for looking though...if you did.

;^)

"steve" <HYPERLINK "mailto:a@b.com"a@b.com> wrote in message
news:10*************@corp.supernews.com...
| here''s the deal...cvs, tick encapsulted data. trying to use regex''s to

| validate records. here''s an example row:
|
|

''AD,''BF'',''132465'',''06/09/2004'','''',''BNSF'',''A'',''TYPE'',''1278'','''',''BR'',''2999'','' ''

| ,''LX'','''',''01'',''09'',''1'','''','''','''','''','''','''','''','''',''CU STOM JOB CODE TEST''
|
| record type is in the 8th column (''1278''). using regex b/c there are a

| miriad of types that cause other data w/n the record (or related
records)
to
| be in/valid. i''m having problems getting a match on the generalization
of
| the first 7 columns:
|
| something like this:
|
| (?=(?:(?<!'','').*(?!='','')'','')){7}(?:''1278(?='',''))
|
| (?=(?:(?<!'','').*(?!='','')'','')){7} represents the first 7 colums.
|
| if someone can help me generalize that patter, i''d appreciate it very
much.
|
| tia,
|
| steve
|
|




-

外发邮件已通过无病毒验证。

由AVG Anti-Virus检查( http://www.grisoft.com)

版本:7.0.230 /病毒数据库:263.3.0 - 发布日期:2004年6月12日



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004


很高兴你解决了它。


我个人讨厌RegExp,我知道通常没有其他明智的或者有效的方法可以做到没有它的东西,但我仍然真的很讨厌它。


-


OHM(特里伯恩斯)

。 。 。单手人。 。

" steve" < a@b.com>在留言中写道

新闻:10 ************* @ corp.supernews.com ...
Glad u solved it.

I personally hate RegExp, I know often there is little other sensible or
efficient way of doing stuff without it, but I still really really hate it.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"steve" <a@b.com> wrote in message
news:10*************@corp.supernews.com...
好事我发布了解释问题......引导我走向
解决方案。记录类型在第7列!!!


(?=(?:(?<!'','')。*(?!='','') '', '')){8}( ''((12((7- [89])|(8 [0-7])|(9 [0-468])))|(13((0 [ 0-3])|(1 [16])|(2 [0135])))| 1612)'')

感谢您寻找...如果您这样做。

; ^)

史蒂夫 < a@b.com>在消息中写道
新闻:10 ************* @ corp.supernews.com ...
|这是交易... cvs,tick封装数据。试图使用正则表达式来
|验证记录。这是一个示例行:
|
|

''AD','BF'',''132465'',''06/09/2004' , '' '', '' BNSF '', '' A '', '' TYPE '', '' 1278', '' '' '' BR '', '' 2999', '' ''| '' LX '', '' '', '' 01 '', '' 09 '', '' 1 '', '' '', '' '', '' '', '' '', ''''',''''''''''''''''''''''''''''''''''''''''''''''''''''记录类型位于第8列(''1278'')。使用正则表达式b / c有一个
|导致其他数据没有记录的类型的miriad(或相关的
记录)
|在/有效。我在| b的泛化
上遇到了问题前7列:
|
|这样的事情:
|
| (????=(:(小于 '', '')*(= '', '') '', '')!。?!){7}(?: '' 1278(=? '' ,''))
|
| (?=(?:(?<!'','')。*(?!='','')'','')){7}代表前7个列。
|
|如果有人可以帮助我概括那种模式,我会非常感激。
|
| tia,
|
|史蒂夫
|
|
good thing i posted the explaination of the problem...lead me right to the
solution. record type is in column 7!!!

(?=(?:(?<!'','').*(?!='','')'','')){8}(''((12((7[89])|(8[0-7])|(9[0-468])))|(13((0[ 0-3])|(1[16])|(2[0135])))|1612)'')

thanks for looking though...if you did.

;^)

"steve" <a@b.com> wrote in message
news:10*************@corp.supernews.com...
| here''s the deal...cvs, tick encapsulted data. trying to use regex''s to
| validate records. here''s an example row:
|
|
''AD,''BF'',''132465'',''06/09/2004'','''',''BNSF'',''A'',''TYPE'',''1278'','''',''BR'',''2999'','' '' | ,''LX'','''',''01'',''09'',''1'','''','''','''','''','''','''','''','''',''CU STOM JOB CODE TEST''
|
| record type is in the 8th column (''1278''). using regex b/c there are a
| miriad of types that cause other data w/n the record (or related records) to
| be in/valid. i''m having problems getting a match on the generalization of | the first 7 columns:
|
| something like this:
|
| (?=(?:(?<!'','').*(?!='','')'','')){7}(?:''1278(?='',''))
|
| (?=(?:(?<!'','').*(?!='','')'','')){7} represents the first 7 colums.
|
| if someone can help me generalize that patter, i''d appreciate it very
much.
|
| tia,
|
| steve
|
|



这篇关于正则表达式亲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆