markdown Regexes ......现在你有两个问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Regexes ......现在你有两个问题相关的知识,希望对你有一定的参考价值。

### yyyy-mm-dd hh:mm:ss
`(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)`

### ip address
`\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}`

### capture Ticks then DateTime
`\d+,\d+,(\d+),([^,]*),.*`


### 2018-05-28T01:48:22.60
`\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d`

### Match lines without specific word, inverse matching
`^((?!text).)*$`

### Replace with lower case, first character, upper case \u
`\l\2`

### Replace with lower case, whole string, upper case \U
`\L\2`

### [Regular Expression Reference: Special Groups] (https://www.regular-expressions.info/refadv.html)
### Match line feeds that don't have a preceding carrier return
`"(?<!`r)`n"`

### Get the last word on a line
`(\w+)\W+$`
## Named capturing group, handy for setting flags
## [Regular Expression Reference: Named Groups and Backreferences](https://www.regular-expressions.info/refext.html)
switch -Regex ($textToRegexOn) {
    "^somestuff(?<hasSwitchM>M)?" {
      
      $hasSwitchM = if($matches.Keys -contains "hasSwitchM") { "Something" } else { "Nothing" }
}
[Regular Expression Reference: Special Groups] (https://www.regular-expressions.info/refadv.html)


### Matches at a position if the pattern inside the lookbehind can be matched ending at that position.
```(?<=regex)```

以上是关于markdown Regexes ......现在你有两个问题的主要内容,如果未能解决你的问题,请参考以下文章

sublime3 sftp 忽略文件的写法

“现代”正则表达式的识别能力

markdown 女人(k)现在

Dubbo 生成文档,导出 Markdown,这些功能 DocView 现在都有了!

Markdown

一个人如何实际使用 Markdown 和 Meteor