English 中文(简体)
Regex:对等特性确定特定次数
原标题:Regex: Matching character set specific number of times

因此,这很可能是一个荒谬的问题,但我似乎无法找到一个可行的答案,因此,如果答案显而易见的话,请原谅我的无知。 我要说的是一位雷克斯公司,其价值大约为8倍。 因此,我尝试了这样的东西:

<><>My Regex>:

 [0-9a-fA-F]{8}

www.un.org/spanish/ecosoc 抽样投入:

 D651000000060D60FADF0DFCE080E020636263633534623231386339

www.un.org/spanish/ecosoc Sample Failing Input(当我不希望取得这一许可时,我所给予的reg类):

 ........@%........$dc073bcc-6aa5

然而,出于某种原因,这赢得了我的工作。 根据我的理解,<代码>{8} 这似乎在C#或附注pad++中工作。

提前感谢!

最佳回答

Your question is slightly confusing as to if you want 6 hex characters, 8 times:

<代码>([0-9a-fA-F]{6}){8}

或8位数位数的超重性:

<代码>[0-9a-fA-F]{8}或[0-9a-fA-F]{4,8},如果您有意要求具备8种特性的话。

我建议:

rel=“noretinger”>http://gskinner.com/RegExr/

如果这些错误得不到,你就可以把你重新试图匹配的价值观样子(指出,如果你在笔记本中具有多个线,那么你也需要寻找新的线性)

问题回答

更直截了当的答案! www.un.org/Depts/DGACM/index_french.htm 我将在这些例子中使用所有数字,从0到9,只是为了简单起见。

  • Match all digits, 8 times: [0-9]{8}
  • Match all digits, 8 or more times: [0-9]{8}[0-9]* (first match 8 times, then match any number of times)

您可在此测试:https://regexr.com/“rel=“nofollow noreferer”https://regexr.com/。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签