Home > OS >  Matching in regular expression
Matching in regular expression

Time:11-06

I'm trying to find many scripts from vscode

I have this code, but it needs improvement.

^@ApplicationTenantLinkId *BIGINT *= *1$

for

@ApplicationTenantLinkId        BIGINT          = 1 
@ApplicationTenantLinkId                BIGINT          = 1 
@ApplicationTenantLinkId        BIGINT          = 1
@ApplicationTenantLinkId        BIGINT          =1
@ApplicationTenantLinkId        BIGINT = 1
@ApplicationTenantLinkId          BIGINT =   1
@ApplicationTenantLinkId BIGINT       =      1

enter image description here

enter image description here

I need to match all cases

CodePudding user response:

Try to replace spaces " *" with \s*:

^@ApplicationTenantLinkId\s*BIGINT\s*=\s*1\s*$

Regex demo.

  • Related