├── .gitignore ├── .vscode └── launch.json ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── readme.md └── src ├── main.rs └── regex_.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "lldb", 9 | "request": "attach", 10 | "name": "Attach", 11 | "pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes 12 | }, 13 | { 14 | "type": "lldb", 15 | "request": "launch", 16 | "name": "Debug executable 'nu_plugin_regex'", 17 | "cargo": { 18 | "args": [ 19 | "build", 20 | "--bin=nu_plugin_regex", 21 | "--package=nu_plugin_regex" 22 | ], 23 | "filter": { 24 | "name": "nu_plugin_regex", 25 | "kind": "bin" 26 | } 27 | }, 28 | "args": [], 29 | "cwd": "${workspaceFolder}" 30 | }, 31 | { 32 | "type": "lldb", 33 | "request": "launch", 34 | "name": "Debug unit tests in executable 'nu_plugin_regex'", 35 | "cargo": { 36 | "args": [ 37 | "test", 38 | "--no-run", 39 | "--bin=nu_plugin_regex", 40 | "--package=nu_plugin_regex" 41 | ], 42 | "filter": { 43 | "name": "nu_plugin_regex", 44 | "kind": "bin" 45 | } 46 | }, 47 | "args": [], 48 | "cwd": "${workspaceFolder}" 49 | } 50 | ] 51 | } -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "adler2" 7 | version = "2.0.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 10 | 11 | [[package]] 12 | name = "aho-corasick" 13 | version = "1.1.3" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 16 | dependencies = [ 17 | "memchr", 18 | ] 19 | 20 | [[package]] 21 | name = "alloc-no-stdlib" 22 | version = "2.0.4" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" 25 | 26 | [[package]] 27 | name = "alloc-stdlib" 28 | version = "0.2.2" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" 31 | dependencies = [ 32 | "alloc-no-stdlib", 33 | ] 34 | 35 | [[package]] 36 | name = "allocator-api2" 37 | version = "0.2.21" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 40 | 41 | [[package]] 42 | name = "android-tzdata" 43 | version = "0.1.1" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 46 | 47 | [[package]] 48 | name = "android_system_properties" 49 | version = "0.1.5" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 52 | dependencies = [ 53 | "libc", 54 | ] 55 | 56 | [[package]] 57 | name = "arrayvec" 58 | version = "0.7.6" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" 61 | 62 | [[package]] 63 | name = "autocfg" 64 | version = "1.4.0" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 67 | 68 | [[package]] 69 | name = "bindgen" 70 | version = "0.70.1" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" 73 | dependencies = [ 74 | "bitflags", 75 | "cexpr", 76 | "clang-sys", 77 | "itertools", 78 | "proc-macro2", 79 | "quote", 80 | "regex", 81 | "rustc-hash", 82 | "shlex", 83 | "syn", 84 | ] 85 | 86 | [[package]] 87 | name = "bit-set" 88 | version = "0.8.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" 91 | dependencies = [ 92 | "bit-vec", 93 | ] 94 | 95 | [[package]] 96 | name = "bit-vec" 97 | version = "0.8.0" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" 100 | 101 | [[package]] 102 | name = "bitflags" 103 | version = "2.8.0" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" 106 | 107 | [[package]] 108 | name = "brotli" 109 | version = "7.0.0" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" 112 | dependencies = [ 113 | "alloc-no-stdlib", 114 | "alloc-stdlib", 115 | "brotli-decompressor", 116 | ] 117 | 118 | [[package]] 119 | name = "brotli-decompressor" 120 | version = "4.0.2" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" 123 | dependencies = [ 124 | "alloc-no-stdlib", 125 | "alloc-stdlib", 126 | ] 127 | 128 | [[package]] 129 | name = "bumpalo" 130 | version = "3.17.0" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" 133 | 134 | [[package]] 135 | name = "byteorder" 136 | version = "1.5.0" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 139 | 140 | [[package]] 141 | name = "bytes" 142 | version = "1.10.0" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" 145 | 146 | [[package]] 147 | name = "bytesize" 148 | version = "1.3.3" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" 151 | 152 | [[package]] 153 | name = "cc" 154 | version = "1.2.13" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" 157 | dependencies = [ 158 | "shlex", 159 | ] 160 | 161 | [[package]] 162 | name = "cexpr" 163 | version = "0.6.0" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 166 | dependencies = [ 167 | "nom", 168 | ] 169 | 170 | [[package]] 171 | name = "cfg-if" 172 | version = "1.0.0" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 175 | 176 | [[package]] 177 | name = "cfg_aliases" 178 | version = "0.2.1" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 181 | 182 | [[package]] 183 | name = "chrono" 184 | version = "0.4.39" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" 187 | dependencies = [ 188 | "android-tzdata", 189 | "iana-time-zone", 190 | "num-traits", 191 | "pure-rust-locales", 192 | "serde", 193 | "windows-targets 0.52.6", 194 | ] 195 | 196 | [[package]] 197 | name = "chrono-humanize" 198 | version = "0.2.3" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "799627e6b4d27827a814e837b9d8a504832086081806d45b1afa34dc982b023b" 201 | dependencies = [ 202 | "chrono", 203 | ] 204 | 205 | [[package]] 206 | name = "clang-sys" 207 | version = "1.8.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" 210 | dependencies = [ 211 | "glob", 212 | "libc", 213 | "libloading", 214 | ] 215 | 216 | [[package]] 217 | name = "const_format" 218 | version = "0.2.34" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" 221 | dependencies = [ 222 | "const_format_proc_macros", 223 | ] 224 | 225 | [[package]] 226 | name = "const_format_proc_macros" 227 | version = "0.2.34" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" 230 | dependencies = [ 231 | "proc-macro2", 232 | "quote", 233 | "unicode-xid", 234 | ] 235 | 236 | [[package]] 237 | name = "core-foundation-sys" 238 | version = "0.8.7" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 241 | 242 | [[package]] 243 | name = "crc32fast" 244 | version = "1.4.2" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" 247 | dependencies = [ 248 | "cfg-if", 249 | ] 250 | 251 | [[package]] 252 | name = "crossbeam-deque" 253 | version = "0.8.6" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" 256 | dependencies = [ 257 | "crossbeam-epoch", 258 | "crossbeam-utils", 259 | ] 260 | 261 | [[package]] 262 | name = "crossbeam-epoch" 263 | version = "0.9.18" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 266 | dependencies = [ 267 | "crossbeam-utils", 268 | ] 269 | 270 | [[package]] 271 | name = "crossbeam-utils" 272 | version = "0.8.21" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" 275 | 276 | [[package]] 277 | name = "crossterm" 278 | version = "0.28.1" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" 281 | dependencies = [ 282 | "bitflags", 283 | "crossterm_winapi", 284 | "mio", 285 | "parking_lot", 286 | "rustix", 287 | "signal-hook", 288 | "signal-hook-mio", 289 | "winapi", 290 | ] 291 | 292 | [[package]] 293 | name = "crossterm_winapi" 294 | version = "0.9.1" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" 297 | dependencies = [ 298 | "winapi", 299 | ] 300 | 301 | [[package]] 302 | name = "deranged" 303 | version = "0.3.11" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 306 | dependencies = [ 307 | "powerfmt", 308 | ] 309 | 310 | [[package]] 311 | name = "dirs" 312 | version = "5.0.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" 315 | dependencies = [ 316 | "dirs-sys", 317 | ] 318 | 319 | [[package]] 320 | name = "dirs-sys" 321 | version = "0.4.1" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" 324 | dependencies = [ 325 | "libc", 326 | "option-ext", 327 | "redox_users", 328 | "windows-sys 0.48.0", 329 | ] 330 | 331 | [[package]] 332 | name = "doctest-file" 333 | version = "1.0.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" 336 | 337 | [[package]] 338 | name = "either" 339 | version = "1.13.0" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 342 | 343 | [[package]] 344 | name = "equivalent" 345 | version = "1.0.1" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 348 | 349 | [[package]] 350 | name = "erased-serde" 351 | version = "0.4.5" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" 354 | dependencies = [ 355 | "serde", 356 | "typeid", 357 | ] 358 | 359 | [[package]] 360 | name = "errno" 361 | version = "0.3.10" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" 364 | dependencies = [ 365 | "libc", 366 | "windows-sys 0.59.0", 367 | ] 368 | 369 | [[package]] 370 | name = "fancy-regex" 371 | version = "0.14.0" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" 374 | dependencies = [ 375 | "bit-set", 376 | "regex-automata", 377 | "regex-syntax", 378 | ] 379 | 380 | [[package]] 381 | name = "flate2" 382 | version = "1.0.35" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" 385 | dependencies = [ 386 | "crc32fast", 387 | "miniz_oxide", 388 | ] 389 | 390 | [[package]] 391 | name = "foldhash" 392 | version = "0.1.4" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" 395 | 396 | [[package]] 397 | name = "getrandom" 398 | version = "0.2.15" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 401 | dependencies = [ 402 | "cfg-if", 403 | "libc", 404 | "wasi", 405 | ] 406 | 407 | [[package]] 408 | name = "glob" 409 | version = "0.3.2" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 412 | 413 | [[package]] 414 | name = "hashbrown" 415 | version = "0.15.2" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 418 | dependencies = [ 419 | "allocator-api2", 420 | "equivalent", 421 | "foldhash", 422 | ] 423 | 424 | [[package]] 425 | name = "heck" 426 | version = "0.5.0" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 429 | 430 | [[package]] 431 | name = "hex" 432 | version = "0.4.3" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 435 | 436 | [[package]] 437 | name = "iana-time-zone" 438 | version = "0.1.61" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" 441 | dependencies = [ 442 | "android_system_properties", 443 | "core-foundation-sys", 444 | "iana-time-zone-haiku", 445 | "js-sys", 446 | "wasm-bindgen", 447 | "windows-core 0.52.0", 448 | ] 449 | 450 | [[package]] 451 | name = "iana-time-zone-haiku" 452 | version = "0.1.2" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 455 | dependencies = [ 456 | "cc", 457 | ] 458 | 459 | [[package]] 460 | name = "indexmap" 461 | version = "2.9.0" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" 464 | dependencies = [ 465 | "equivalent", 466 | "hashbrown", 467 | ] 468 | 469 | [[package]] 470 | name = "interprocess" 471 | version = "2.2.2" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" 474 | dependencies = [ 475 | "doctest-file", 476 | "libc", 477 | "recvmsg", 478 | "widestring", 479 | "windows-sys 0.52.0", 480 | ] 481 | 482 | [[package]] 483 | name = "inventory" 484 | version = "0.3.19" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "54b12ebb6799019b044deaf431eadfe23245b259bba5a2c0796acec3943a3cdb" 487 | dependencies = [ 488 | "rustversion", 489 | ] 490 | 491 | [[package]] 492 | name = "is_ci" 493 | version = "1.2.0" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" 496 | 497 | [[package]] 498 | name = "is_debug" 499 | version = "1.1.0" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "1fe266d2e243c931d8190177f20bf7f24eed45e96f39e87dc49a27b32d12d407" 502 | 503 | [[package]] 504 | name = "itertools" 505 | version = "0.13.0" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" 508 | dependencies = [ 509 | "either", 510 | ] 511 | 512 | [[package]] 513 | name = "itoa" 514 | version = "1.0.14" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" 517 | 518 | [[package]] 519 | name = "js-sys" 520 | version = "0.3.77" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" 523 | dependencies = [ 524 | "once_cell", 525 | "wasm-bindgen", 526 | ] 527 | 528 | [[package]] 529 | name = "libc" 530 | version = "0.2.169" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" 533 | 534 | [[package]] 535 | name = "libloading" 536 | version = "0.8.6" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" 539 | dependencies = [ 540 | "cfg-if", 541 | "windows-targets 0.52.6", 542 | ] 543 | 544 | [[package]] 545 | name = "libproc" 546 | version = "0.14.10" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "e78a09b56be5adbcad5aa1197371688dc6bb249a26da3bca2011ee2fb987ebfb" 549 | dependencies = [ 550 | "bindgen", 551 | "errno", 552 | "libc", 553 | ] 554 | 555 | [[package]] 556 | name = "libredox" 557 | version = "0.1.3" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" 560 | dependencies = [ 561 | "bitflags", 562 | "libc", 563 | ] 564 | 565 | [[package]] 566 | name = "linux-raw-sys" 567 | version = "0.4.15" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" 570 | 571 | [[package]] 572 | name = "lock_api" 573 | version = "0.4.12" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 576 | dependencies = [ 577 | "autocfg", 578 | "scopeguard", 579 | ] 580 | 581 | [[package]] 582 | name = "log" 583 | version = "0.4.25" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" 586 | 587 | [[package]] 588 | name = "lru" 589 | version = "0.12.5" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" 592 | dependencies = [ 593 | "hashbrown", 594 | ] 595 | 596 | [[package]] 597 | name = "lscolors" 598 | version = "0.17.0" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "53304fff6ab1e597661eee37e42ea8c47a146fca280af902bb76bff8a896e523" 601 | dependencies = [ 602 | "nu-ansi-term", 603 | ] 604 | 605 | [[package]] 606 | name = "mach2" 607 | version = "0.4.2" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" 610 | dependencies = [ 611 | "libc", 612 | ] 613 | 614 | [[package]] 615 | name = "memchr" 616 | version = "2.7.4" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 619 | 620 | [[package]] 621 | name = "miette" 622 | version = "7.5.0" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" 625 | dependencies = [ 626 | "cfg-if", 627 | "miette-derive", 628 | "owo-colors", 629 | "supports-color", 630 | "supports-hyperlinks", 631 | "supports-unicode", 632 | "terminal_size", 633 | "textwrap", 634 | "thiserror 1.0.69", 635 | "unicode-width", 636 | ] 637 | 638 | [[package]] 639 | name = "miette-derive" 640 | version = "7.5.0" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" 643 | dependencies = [ 644 | "proc-macro2", 645 | "quote", 646 | "syn", 647 | ] 648 | 649 | [[package]] 650 | name = "minimal-lexical" 651 | version = "0.2.1" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 654 | 655 | [[package]] 656 | name = "miniz_oxide" 657 | version = "0.8.3" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" 660 | dependencies = [ 661 | "adler2", 662 | ] 663 | 664 | [[package]] 665 | name = "mio" 666 | version = "1.0.3" 667 | source = "registry+https://github.com/rust-lang/crates.io-index" 668 | checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" 669 | dependencies = [ 670 | "libc", 671 | "log", 672 | "wasi", 673 | "windows-sys 0.52.0", 674 | ] 675 | 676 | [[package]] 677 | name = "nix" 678 | version = "0.29.0" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" 681 | dependencies = [ 682 | "bitflags", 683 | "cfg-if", 684 | "cfg_aliases", 685 | "libc", 686 | ] 687 | 688 | [[package]] 689 | name = "nom" 690 | version = "7.1.3" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 693 | dependencies = [ 694 | "memchr", 695 | "minimal-lexical", 696 | ] 697 | 698 | [[package]] 699 | name = "ntapi" 700 | version = "0.4.1" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" 703 | dependencies = [ 704 | "winapi", 705 | ] 706 | 707 | [[package]] 708 | name = "nu-ansi-term" 709 | version = "0.50.1" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" 712 | dependencies = [ 713 | "windows-sys 0.52.0", 714 | ] 715 | 716 | [[package]] 717 | name = "nu-cmd-lang" 718 | version = "0.104.0" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "e66adfeda88f8e27bcb25d068d9e6e8b3a94c2bf988a9c30e8e3b2045867aefe" 721 | dependencies = [ 722 | "itertools", 723 | "nu-engine", 724 | "nu-parser", 725 | "nu-protocol", 726 | "nu-utils", 727 | "shadow-rs", 728 | ] 729 | 730 | [[package]] 731 | name = "nu-derive-value" 732 | version = "0.104.0" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "5fd0d8e358b6440d01fe4e617f180aea826bade72efb54f5dc1c22e0e8038b6f" 735 | dependencies = [ 736 | "heck", 737 | "proc-macro-error2", 738 | "proc-macro2", 739 | "quote", 740 | "syn", 741 | ] 742 | 743 | [[package]] 744 | name = "nu-engine" 745 | version = "0.104.0" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "0c2b01483e3d09460375f0c0da7a83b6dc26fb319ca09c55d0665087b2d587c7" 748 | dependencies = [ 749 | "log", 750 | "nu-glob", 751 | "nu-path", 752 | "nu-protocol", 753 | "nu-utils", 754 | ] 755 | 756 | [[package]] 757 | name = "nu-glob" 758 | version = "0.104.0" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "202ce25889336061efea24e69d4e0de7147c15fd9892cdd70533500d47db8364" 761 | 762 | [[package]] 763 | name = "nu-parser" 764 | version = "0.104.0" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "cb0591ef4d4989c1930863d9d17d8fd2d70b03ec2d9caeca067e9626e05c49d9" 767 | dependencies = [ 768 | "bytesize", 769 | "chrono", 770 | "itertools", 771 | "log", 772 | "nu-engine", 773 | "nu-path", 774 | "nu-plugin-engine", 775 | "nu-protocol", 776 | "nu-utils", 777 | "serde_json", 778 | ] 779 | 780 | [[package]] 781 | name = "nu-path" 782 | version = "0.104.0" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "41c68c7c06898a5c4c9f10038da63759661cb8ac8f301ce7d159173a595c8258" 785 | dependencies = [ 786 | "dirs", 787 | "omnipath", 788 | "pwd", 789 | "ref-cast", 790 | ] 791 | 792 | [[package]] 793 | name = "nu-plugin" 794 | version = "0.104.0" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "e00d2ccb35a1206c51740bea63b0deb72dc4c34ca6ceae6feac95f84d68370d2" 797 | dependencies = [ 798 | "log", 799 | "nix", 800 | "nu-engine", 801 | "nu-plugin-core", 802 | "nu-plugin-protocol", 803 | "nu-protocol", 804 | "nu-utils", 805 | "thiserror 2.0.12", 806 | ] 807 | 808 | [[package]] 809 | name = "nu-plugin-core" 810 | version = "0.104.0" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "30e416e6de2b62925ffc1924740a0e5340316a1630af3d2490d513bcb1f94e94" 813 | dependencies = [ 814 | "interprocess", 815 | "log", 816 | "nu-plugin-protocol", 817 | "nu-protocol", 818 | "rmp-serde", 819 | "serde", 820 | "serde_json", 821 | "windows 0.56.0", 822 | ] 823 | 824 | [[package]] 825 | name = "nu-plugin-engine" 826 | version = "0.104.0" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "14fb214ba23829ebfe61b9a5e0688cd5620922438d7d76a6f6b3e1151d07e82a" 829 | dependencies = [ 830 | "log", 831 | "nu-engine", 832 | "nu-plugin-core", 833 | "nu-plugin-protocol", 834 | "nu-protocol", 835 | "nu-system", 836 | "nu-utils", 837 | "serde", 838 | "windows 0.56.0", 839 | ] 840 | 841 | [[package]] 842 | name = "nu-plugin-protocol" 843 | version = "0.104.0" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "be7edbdee451bb29150b5e8184660d79d0c0801a6748b9f712b758cb78110305" 846 | dependencies = [ 847 | "nu-protocol", 848 | "nu-utils", 849 | "rmp-serde", 850 | "semver", 851 | "serde", 852 | "typetag", 853 | ] 854 | 855 | [[package]] 856 | name = "nu-plugin-test-support" 857 | version = "0.104.0" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "b8acb62c21fd980e467162bc17a4e93a8435e28249256b52e58718278149978d" 860 | dependencies = [ 861 | "nu-ansi-term", 862 | "nu-cmd-lang", 863 | "nu-engine", 864 | "nu-parser", 865 | "nu-plugin", 866 | "nu-plugin-core", 867 | "nu-plugin-engine", 868 | "nu-plugin-protocol", 869 | "nu-protocol", 870 | "similar", 871 | ] 872 | 873 | [[package]] 874 | name = "nu-protocol" 875 | version = "0.104.0" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | checksum = "ab657b1947f1fad3c5052cb210fa311744736a4800a966ae21c4bc63de7c60ab" 878 | dependencies = [ 879 | "brotli", 880 | "bytes", 881 | "chrono", 882 | "chrono-humanize", 883 | "dirs", 884 | "dirs-sys", 885 | "fancy-regex", 886 | "heck", 887 | "indexmap", 888 | "log", 889 | "lru", 890 | "memchr", 891 | "miette", 892 | "nix", 893 | "nu-derive-value", 894 | "nu-glob", 895 | "nu-path", 896 | "nu-system", 897 | "nu-utils", 898 | "num-format", 899 | "os_pipe", 900 | "rmp-serde", 901 | "serde", 902 | "serde_json", 903 | "strum", 904 | "strum_macros", 905 | "thiserror 2.0.12", 906 | "typetag", 907 | "web-time", 908 | "windows-sys 0.48.0", 909 | ] 910 | 911 | [[package]] 912 | name = "nu-system" 913 | version = "0.104.0" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "f47094aaab4f1e3a86c3960400d82a50fcabde907f964ae095963ec95669577a" 916 | dependencies = [ 917 | "chrono", 918 | "itertools", 919 | "libc", 920 | "libproc", 921 | "log", 922 | "mach2", 923 | "nix", 924 | "ntapi", 925 | "procfs", 926 | "sysinfo", 927 | "web-time", 928 | "windows 0.56.0", 929 | ] 930 | 931 | [[package]] 932 | name = "nu-utils" 933 | version = "0.104.0" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "327999b774d78b301a6b68c33d312a1a8047c59fb8971b6552ebf823251f1481" 936 | dependencies = [ 937 | "crossterm", 938 | "crossterm_winapi", 939 | "fancy-regex", 940 | "log", 941 | "lscolors", 942 | "nix", 943 | "num-format", 944 | "serde", 945 | "serde_json", 946 | "strip-ansi-escapes", 947 | "sys-locale", 948 | "unicase", 949 | ] 950 | 951 | [[package]] 952 | name = "nu_plugin_regex" 953 | version = "0.13.0" 954 | dependencies = [ 955 | "fancy-regex", 956 | "nu-path", 957 | "nu-plugin", 958 | "nu-plugin-test-support", 959 | "nu-protocol", 960 | ] 961 | 962 | [[package]] 963 | name = "num-conv" 964 | version = "0.1.0" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 967 | 968 | [[package]] 969 | name = "num-format" 970 | version = "0.4.4" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" 973 | dependencies = [ 974 | "arrayvec", 975 | "itoa", 976 | ] 977 | 978 | [[package]] 979 | name = "num-traits" 980 | version = "0.2.19" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 983 | dependencies = [ 984 | "autocfg", 985 | ] 986 | 987 | [[package]] 988 | name = "num_threads" 989 | version = "0.1.7" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" 992 | dependencies = [ 993 | "libc", 994 | ] 995 | 996 | [[package]] 997 | name = "omnipath" 998 | version = "0.1.6" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" 1001 | 1002 | [[package]] 1003 | name = "once_cell" 1004 | version = "1.20.3" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" 1007 | 1008 | [[package]] 1009 | name = "option-ext" 1010 | version = "0.2.0" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 1013 | 1014 | [[package]] 1015 | name = "os_pipe" 1016 | version = "1.2.1" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" 1019 | dependencies = [ 1020 | "libc", 1021 | "windows-sys 0.59.0", 1022 | ] 1023 | 1024 | [[package]] 1025 | name = "owo-colors" 1026 | version = "4.1.0" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" 1029 | 1030 | [[package]] 1031 | name = "parking_lot" 1032 | version = "0.12.3" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 1035 | dependencies = [ 1036 | "lock_api", 1037 | "parking_lot_core", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "parking_lot_core" 1042 | version = "0.9.10" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 1045 | dependencies = [ 1046 | "cfg-if", 1047 | "libc", 1048 | "redox_syscall", 1049 | "smallvec", 1050 | "windows-targets 0.52.6", 1051 | ] 1052 | 1053 | [[package]] 1054 | name = "paste" 1055 | version = "1.0.15" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 1058 | 1059 | [[package]] 1060 | name = "powerfmt" 1061 | version = "0.2.0" 1062 | source = "registry+https://github.com/rust-lang/crates.io-index" 1063 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1064 | 1065 | [[package]] 1066 | name = "proc-macro-error-attr2" 1067 | version = "2.0.0" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" 1070 | dependencies = [ 1071 | "proc-macro2", 1072 | "quote", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "proc-macro-error2" 1077 | version = "2.0.1" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" 1080 | dependencies = [ 1081 | "proc-macro-error-attr2", 1082 | "proc-macro2", 1083 | "quote", 1084 | "syn", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "proc-macro2" 1089 | version = "1.0.93" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" 1092 | dependencies = [ 1093 | "unicode-ident", 1094 | ] 1095 | 1096 | [[package]] 1097 | name = "procfs" 1098 | version = "0.17.0" 1099 | source = "registry+https://github.com/rust-lang/crates.io-index" 1100 | checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" 1101 | dependencies = [ 1102 | "bitflags", 1103 | "chrono", 1104 | "flate2", 1105 | "hex", 1106 | "procfs-core", 1107 | "rustix", 1108 | ] 1109 | 1110 | [[package]] 1111 | name = "procfs-core" 1112 | version = "0.17.0" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" 1115 | dependencies = [ 1116 | "bitflags", 1117 | "chrono", 1118 | "hex", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "pure-rust-locales" 1123 | version = "0.8.1" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" 1126 | 1127 | [[package]] 1128 | name = "pwd" 1129 | version = "1.4.0" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" 1132 | dependencies = [ 1133 | "libc", 1134 | "thiserror 1.0.69", 1135 | ] 1136 | 1137 | [[package]] 1138 | name = "quote" 1139 | version = "1.0.38" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" 1142 | dependencies = [ 1143 | "proc-macro2", 1144 | ] 1145 | 1146 | [[package]] 1147 | name = "rayon" 1148 | version = "1.10.0" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 1151 | dependencies = [ 1152 | "either", 1153 | "rayon-core", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "rayon-core" 1158 | version = "1.12.1" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 1161 | dependencies = [ 1162 | "crossbeam-deque", 1163 | "crossbeam-utils", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "recvmsg" 1168 | version = "1.0.0" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" 1171 | 1172 | [[package]] 1173 | name = "redox_syscall" 1174 | version = "0.5.8" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" 1177 | dependencies = [ 1178 | "bitflags", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "redox_users" 1183 | version = "0.4.6" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" 1186 | dependencies = [ 1187 | "getrandom", 1188 | "libredox", 1189 | "thiserror 1.0.69", 1190 | ] 1191 | 1192 | [[package]] 1193 | name = "ref-cast" 1194 | version = "1.0.23" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" 1197 | dependencies = [ 1198 | "ref-cast-impl", 1199 | ] 1200 | 1201 | [[package]] 1202 | name = "ref-cast-impl" 1203 | version = "1.0.23" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" 1206 | dependencies = [ 1207 | "proc-macro2", 1208 | "quote", 1209 | "syn", 1210 | ] 1211 | 1212 | [[package]] 1213 | name = "regex" 1214 | version = "1.11.1" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 1217 | dependencies = [ 1218 | "aho-corasick", 1219 | "memchr", 1220 | "regex-automata", 1221 | "regex-syntax", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "regex-automata" 1226 | version = "0.4.9" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 1229 | dependencies = [ 1230 | "aho-corasick", 1231 | "memchr", 1232 | "regex-syntax", 1233 | ] 1234 | 1235 | [[package]] 1236 | name = "regex-syntax" 1237 | version = "0.8.5" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1240 | 1241 | [[package]] 1242 | name = "rmp" 1243 | version = "0.8.14" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" 1246 | dependencies = [ 1247 | "byteorder", 1248 | "num-traits", 1249 | "paste", 1250 | ] 1251 | 1252 | [[package]] 1253 | name = "rmp-serde" 1254 | version = "1.3.0" 1255 | source = "registry+https://github.com/rust-lang/crates.io-index" 1256 | checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" 1257 | dependencies = [ 1258 | "byteorder", 1259 | "rmp", 1260 | "serde", 1261 | ] 1262 | 1263 | [[package]] 1264 | name = "rustc-hash" 1265 | version = "1.1.0" 1266 | source = "registry+https://github.com/rust-lang/crates.io-index" 1267 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1268 | 1269 | [[package]] 1270 | name = "rustix" 1271 | version = "0.38.44" 1272 | source = "registry+https://github.com/rust-lang/crates.io-index" 1273 | checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" 1274 | dependencies = [ 1275 | "bitflags", 1276 | "errno", 1277 | "libc", 1278 | "linux-raw-sys", 1279 | "windows-sys 0.59.0", 1280 | ] 1281 | 1282 | [[package]] 1283 | name = "rustversion" 1284 | version = "1.0.19" 1285 | source = "registry+https://github.com/rust-lang/crates.io-index" 1286 | checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" 1287 | 1288 | [[package]] 1289 | name = "ryu" 1290 | version = "1.0.19" 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" 1292 | checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" 1293 | 1294 | [[package]] 1295 | name = "scopeguard" 1296 | version = "1.2.0" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1299 | 1300 | [[package]] 1301 | name = "semver" 1302 | version = "1.0.25" 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" 1304 | checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" 1305 | 1306 | [[package]] 1307 | name = "serde" 1308 | version = "1.0.217" 1309 | source = "registry+https://github.com/rust-lang/crates.io-index" 1310 | checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" 1311 | dependencies = [ 1312 | "serde_derive", 1313 | ] 1314 | 1315 | [[package]] 1316 | name = "serde_derive" 1317 | version = "1.0.217" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" 1320 | dependencies = [ 1321 | "proc-macro2", 1322 | "quote", 1323 | "syn", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "serde_json" 1328 | version = "1.0.138" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" 1331 | dependencies = [ 1332 | "itoa", 1333 | "memchr", 1334 | "ryu", 1335 | "serde", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "shadow-rs" 1340 | version = "1.1.1" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "6d5625ed609cf66d7e505e7d487aca815626dc4ebb6c0dd07637ca61a44651a6" 1343 | dependencies = [ 1344 | "const_format", 1345 | "is_debug", 1346 | "time", 1347 | "tzdb", 1348 | ] 1349 | 1350 | [[package]] 1351 | name = "shlex" 1352 | version = "1.3.0" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1355 | 1356 | [[package]] 1357 | name = "signal-hook" 1358 | version = "0.3.17" 1359 | source = "registry+https://github.com/rust-lang/crates.io-index" 1360 | checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" 1361 | dependencies = [ 1362 | "libc", 1363 | "signal-hook-registry", 1364 | ] 1365 | 1366 | [[package]] 1367 | name = "signal-hook-mio" 1368 | version = "0.2.4" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" 1371 | dependencies = [ 1372 | "libc", 1373 | "mio", 1374 | "signal-hook", 1375 | ] 1376 | 1377 | [[package]] 1378 | name = "signal-hook-registry" 1379 | version = "1.4.2" 1380 | source = "registry+https://github.com/rust-lang/crates.io-index" 1381 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1382 | dependencies = [ 1383 | "libc", 1384 | ] 1385 | 1386 | [[package]] 1387 | name = "similar" 1388 | version = "2.7.0" 1389 | source = "registry+https://github.com/rust-lang/crates.io-index" 1390 | checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" 1391 | 1392 | [[package]] 1393 | name = "smallvec" 1394 | version = "1.13.2" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1397 | 1398 | [[package]] 1399 | name = "strip-ansi-escapes" 1400 | version = "0.2.1" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" 1403 | dependencies = [ 1404 | "vte", 1405 | ] 1406 | 1407 | [[package]] 1408 | name = "strum" 1409 | version = "0.26.3" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" 1412 | 1413 | [[package]] 1414 | name = "strum_macros" 1415 | version = "0.26.4" 1416 | source = "registry+https://github.com/rust-lang/crates.io-index" 1417 | checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" 1418 | dependencies = [ 1419 | "heck", 1420 | "proc-macro2", 1421 | "quote", 1422 | "rustversion", 1423 | "syn", 1424 | ] 1425 | 1426 | [[package]] 1427 | name = "supports-color" 1428 | version = "3.0.2" 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" 1430 | checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" 1431 | dependencies = [ 1432 | "is_ci", 1433 | ] 1434 | 1435 | [[package]] 1436 | name = "supports-hyperlinks" 1437 | version = "3.1.0" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" 1440 | 1441 | [[package]] 1442 | name = "supports-unicode" 1443 | version = "3.0.0" 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" 1445 | checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" 1446 | 1447 | [[package]] 1448 | name = "syn" 1449 | version = "2.0.98" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" 1452 | dependencies = [ 1453 | "proc-macro2", 1454 | "quote", 1455 | "unicode-ident", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "sys-locale" 1460 | version = "0.3.2" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" 1463 | dependencies = [ 1464 | "libc", 1465 | ] 1466 | 1467 | [[package]] 1468 | name = "sysinfo" 1469 | version = "0.33.1" 1470 | source = "registry+https://github.com/rust-lang/crates.io-index" 1471 | checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" 1472 | dependencies = [ 1473 | "core-foundation-sys", 1474 | "libc", 1475 | "memchr", 1476 | "ntapi", 1477 | "rayon", 1478 | "windows 0.57.0", 1479 | ] 1480 | 1481 | [[package]] 1482 | name = "terminal_size" 1483 | version = "0.4.1" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" 1486 | dependencies = [ 1487 | "rustix", 1488 | "windows-sys 0.59.0", 1489 | ] 1490 | 1491 | [[package]] 1492 | name = "textwrap" 1493 | version = "0.16.1" 1494 | source = "registry+https://github.com/rust-lang/crates.io-index" 1495 | checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" 1496 | dependencies = [ 1497 | "unicode-linebreak", 1498 | "unicode-width", 1499 | ] 1500 | 1501 | [[package]] 1502 | name = "thiserror" 1503 | version = "1.0.69" 1504 | source = "registry+https://github.com/rust-lang/crates.io-index" 1505 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1506 | dependencies = [ 1507 | "thiserror-impl 1.0.69", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "thiserror" 1512 | version = "2.0.12" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 1515 | dependencies = [ 1516 | "thiserror-impl 2.0.12", 1517 | ] 1518 | 1519 | [[package]] 1520 | name = "thiserror-impl" 1521 | version = "1.0.69" 1522 | source = "registry+https://github.com/rust-lang/crates.io-index" 1523 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1524 | dependencies = [ 1525 | "proc-macro2", 1526 | "quote", 1527 | "syn", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "thiserror-impl" 1532 | version = "2.0.12" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 1535 | dependencies = [ 1536 | "proc-macro2", 1537 | "quote", 1538 | "syn", 1539 | ] 1540 | 1541 | [[package]] 1542 | name = "time" 1543 | version = "0.3.37" 1544 | source = "registry+https://github.com/rust-lang/crates.io-index" 1545 | checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" 1546 | dependencies = [ 1547 | "deranged", 1548 | "itoa", 1549 | "libc", 1550 | "num-conv", 1551 | "num_threads", 1552 | "powerfmt", 1553 | "serde", 1554 | "time-core", 1555 | "time-macros", 1556 | ] 1557 | 1558 | [[package]] 1559 | name = "time-core" 1560 | version = "0.1.2" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 1563 | 1564 | [[package]] 1565 | name = "time-macros" 1566 | version = "0.2.19" 1567 | source = "registry+https://github.com/rust-lang/crates.io-index" 1568 | checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" 1569 | dependencies = [ 1570 | "num-conv", 1571 | "time-core", 1572 | ] 1573 | 1574 | [[package]] 1575 | name = "typeid" 1576 | version = "1.0.2" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" 1579 | 1580 | [[package]] 1581 | name = "typetag" 1582 | version = "0.2.19" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "044fc3365ddd307c297fe0fe7b2e70588cdab4d0f62dc52055ca0d11b174cf0e" 1585 | dependencies = [ 1586 | "erased-serde", 1587 | "inventory", 1588 | "once_cell", 1589 | "serde", 1590 | "typetag-impl", 1591 | ] 1592 | 1593 | [[package]] 1594 | name = "typetag-impl" 1595 | version = "0.2.19" 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" 1597 | checksum = "d9d30226ac9cbd2d1ff775f74e8febdab985dab14fb14aa2582c29a92d5555dc" 1598 | dependencies = [ 1599 | "proc-macro2", 1600 | "quote", 1601 | "syn", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "tz-rs" 1606 | version = "0.7.0" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "e1450bf2b99397e72070e7935c89facaa80092ac812502200375f1f7d33c71a1" 1609 | 1610 | [[package]] 1611 | name = "tzdb" 1612 | version = "0.7.2" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "0be2ea5956f295449f47c0b825c5e109022ff1a6a53bb4f77682a87c2341fbf5" 1615 | dependencies = [ 1616 | "iana-time-zone", 1617 | "tz-rs", 1618 | "tzdb_data", 1619 | ] 1620 | 1621 | [[package]] 1622 | name = "tzdb_data" 1623 | version = "0.2.2" 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" 1625 | checksum = "9c4c81d75033770e40fbd3643ce7472a1a9fd301f90b7139038228daf8af03ec" 1626 | dependencies = [ 1627 | "tz-rs", 1628 | ] 1629 | 1630 | [[package]] 1631 | name = "unicase" 1632 | version = "2.8.1" 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" 1634 | checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" 1635 | 1636 | [[package]] 1637 | name = "unicode-ident" 1638 | version = "1.0.16" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" 1641 | 1642 | [[package]] 1643 | name = "unicode-linebreak" 1644 | version = "0.1.5" 1645 | source = "registry+https://github.com/rust-lang/crates.io-index" 1646 | checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" 1647 | 1648 | [[package]] 1649 | name = "unicode-width" 1650 | version = "0.1.14" 1651 | source = "registry+https://github.com/rust-lang/crates.io-index" 1652 | checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" 1653 | 1654 | [[package]] 1655 | name = "unicode-xid" 1656 | version = "0.2.6" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 1659 | 1660 | [[package]] 1661 | name = "vte" 1662 | version = "0.14.1" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" 1665 | dependencies = [ 1666 | "memchr", 1667 | ] 1668 | 1669 | [[package]] 1670 | name = "wasi" 1671 | version = "0.11.0+wasi-snapshot-preview1" 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" 1673 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1674 | 1675 | [[package]] 1676 | name = "wasm-bindgen" 1677 | version = "0.2.100" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" 1680 | dependencies = [ 1681 | "cfg-if", 1682 | "once_cell", 1683 | "rustversion", 1684 | "wasm-bindgen-macro", 1685 | ] 1686 | 1687 | [[package]] 1688 | name = "wasm-bindgen-backend" 1689 | version = "0.2.100" 1690 | source = "registry+https://github.com/rust-lang/crates.io-index" 1691 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" 1692 | dependencies = [ 1693 | "bumpalo", 1694 | "log", 1695 | "proc-macro2", 1696 | "quote", 1697 | "syn", 1698 | "wasm-bindgen-shared", 1699 | ] 1700 | 1701 | [[package]] 1702 | name = "wasm-bindgen-macro" 1703 | version = "0.2.100" 1704 | source = "registry+https://github.com/rust-lang/crates.io-index" 1705 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" 1706 | dependencies = [ 1707 | "quote", 1708 | "wasm-bindgen-macro-support", 1709 | ] 1710 | 1711 | [[package]] 1712 | name = "wasm-bindgen-macro-support" 1713 | version = "0.2.100" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" 1716 | dependencies = [ 1717 | "proc-macro2", 1718 | "quote", 1719 | "syn", 1720 | "wasm-bindgen-backend", 1721 | "wasm-bindgen-shared", 1722 | ] 1723 | 1724 | [[package]] 1725 | name = "wasm-bindgen-shared" 1726 | version = "0.2.100" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" 1729 | dependencies = [ 1730 | "unicode-ident", 1731 | ] 1732 | 1733 | [[package]] 1734 | name = "web-time" 1735 | version = "1.1.0" 1736 | source = "registry+https://github.com/rust-lang/crates.io-index" 1737 | checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" 1738 | dependencies = [ 1739 | "js-sys", 1740 | "wasm-bindgen", 1741 | ] 1742 | 1743 | [[package]] 1744 | name = "widestring" 1745 | version = "1.1.0" 1746 | source = "registry+https://github.com/rust-lang/crates.io-index" 1747 | checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" 1748 | 1749 | [[package]] 1750 | name = "winapi" 1751 | version = "0.3.9" 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" 1753 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1754 | dependencies = [ 1755 | "winapi-i686-pc-windows-gnu", 1756 | "winapi-x86_64-pc-windows-gnu", 1757 | ] 1758 | 1759 | [[package]] 1760 | name = "winapi-i686-pc-windows-gnu" 1761 | version = "0.4.0" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1764 | 1765 | [[package]] 1766 | name = "winapi-x86_64-pc-windows-gnu" 1767 | version = "0.4.0" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1770 | 1771 | [[package]] 1772 | name = "windows" 1773 | version = "0.56.0" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" 1776 | dependencies = [ 1777 | "windows-core 0.56.0", 1778 | "windows-targets 0.52.6", 1779 | ] 1780 | 1781 | [[package]] 1782 | name = "windows" 1783 | version = "0.57.0" 1784 | source = "registry+https://github.com/rust-lang/crates.io-index" 1785 | checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" 1786 | dependencies = [ 1787 | "windows-core 0.57.0", 1788 | "windows-targets 0.52.6", 1789 | ] 1790 | 1791 | [[package]] 1792 | name = "windows-core" 1793 | version = "0.52.0" 1794 | source = "registry+https://github.com/rust-lang/crates.io-index" 1795 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1796 | dependencies = [ 1797 | "windows-targets 0.52.6", 1798 | ] 1799 | 1800 | [[package]] 1801 | name = "windows-core" 1802 | version = "0.56.0" 1803 | source = "registry+https://github.com/rust-lang/crates.io-index" 1804 | checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" 1805 | dependencies = [ 1806 | "windows-implement 0.56.0", 1807 | "windows-interface 0.56.0", 1808 | "windows-result", 1809 | "windows-targets 0.52.6", 1810 | ] 1811 | 1812 | [[package]] 1813 | name = "windows-core" 1814 | version = "0.57.0" 1815 | source = "registry+https://github.com/rust-lang/crates.io-index" 1816 | checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" 1817 | dependencies = [ 1818 | "windows-implement 0.57.0", 1819 | "windows-interface 0.57.0", 1820 | "windows-result", 1821 | "windows-targets 0.52.6", 1822 | ] 1823 | 1824 | [[package]] 1825 | name = "windows-implement" 1826 | version = "0.56.0" 1827 | source = "registry+https://github.com/rust-lang/crates.io-index" 1828 | checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" 1829 | dependencies = [ 1830 | "proc-macro2", 1831 | "quote", 1832 | "syn", 1833 | ] 1834 | 1835 | [[package]] 1836 | name = "windows-implement" 1837 | version = "0.57.0" 1838 | source = "registry+https://github.com/rust-lang/crates.io-index" 1839 | checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" 1840 | dependencies = [ 1841 | "proc-macro2", 1842 | "quote", 1843 | "syn", 1844 | ] 1845 | 1846 | [[package]] 1847 | name = "windows-interface" 1848 | version = "0.56.0" 1849 | source = "registry+https://github.com/rust-lang/crates.io-index" 1850 | checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" 1851 | dependencies = [ 1852 | "proc-macro2", 1853 | "quote", 1854 | "syn", 1855 | ] 1856 | 1857 | [[package]] 1858 | name = "windows-interface" 1859 | version = "0.57.0" 1860 | source = "registry+https://github.com/rust-lang/crates.io-index" 1861 | checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" 1862 | dependencies = [ 1863 | "proc-macro2", 1864 | "quote", 1865 | "syn", 1866 | ] 1867 | 1868 | [[package]] 1869 | name = "windows-result" 1870 | version = "0.1.2" 1871 | source = "registry+https://github.com/rust-lang/crates.io-index" 1872 | checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" 1873 | dependencies = [ 1874 | "windows-targets 0.52.6", 1875 | ] 1876 | 1877 | [[package]] 1878 | name = "windows-sys" 1879 | version = "0.48.0" 1880 | source = "registry+https://github.com/rust-lang/crates.io-index" 1881 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1882 | dependencies = [ 1883 | "windows-targets 0.48.5", 1884 | ] 1885 | 1886 | [[package]] 1887 | name = "windows-sys" 1888 | version = "0.52.0" 1889 | source = "registry+https://github.com/rust-lang/crates.io-index" 1890 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1891 | dependencies = [ 1892 | "windows-targets 0.52.6", 1893 | ] 1894 | 1895 | [[package]] 1896 | name = "windows-sys" 1897 | version = "0.59.0" 1898 | source = "registry+https://github.com/rust-lang/crates.io-index" 1899 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1900 | dependencies = [ 1901 | "windows-targets 0.52.6", 1902 | ] 1903 | 1904 | [[package]] 1905 | name = "windows-targets" 1906 | version = "0.48.5" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1909 | dependencies = [ 1910 | "windows_aarch64_gnullvm 0.48.5", 1911 | "windows_aarch64_msvc 0.48.5", 1912 | "windows_i686_gnu 0.48.5", 1913 | "windows_i686_msvc 0.48.5", 1914 | "windows_x86_64_gnu 0.48.5", 1915 | "windows_x86_64_gnullvm 0.48.5", 1916 | "windows_x86_64_msvc 0.48.5", 1917 | ] 1918 | 1919 | [[package]] 1920 | name = "windows-targets" 1921 | version = "0.52.6" 1922 | source = "registry+https://github.com/rust-lang/crates.io-index" 1923 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1924 | dependencies = [ 1925 | "windows_aarch64_gnullvm 0.52.6", 1926 | "windows_aarch64_msvc 0.52.6", 1927 | "windows_i686_gnu 0.52.6", 1928 | "windows_i686_gnullvm", 1929 | "windows_i686_msvc 0.52.6", 1930 | "windows_x86_64_gnu 0.52.6", 1931 | "windows_x86_64_gnullvm 0.52.6", 1932 | "windows_x86_64_msvc 0.52.6", 1933 | ] 1934 | 1935 | [[package]] 1936 | name = "windows_aarch64_gnullvm" 1937 | version = "0.48.5" 1938 | source = "registry+https://github.com/rust-lang/crates.io-index" 1939 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1940 | 1941 | [[package]] 1942 | name = "windows_aarch64_gnullvm" 1943 | version = "0.52.6" 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" 1945 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1946 | 1947 | [[package]] 1948 | name = "windows_aarch64_msvc" 1949 | version = "0.48.5" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1952 | 1953 | [[package]] 1954 | name = "windows_aarch64_msvc" 1955 | version = "0.52.6" 1956 | source = "registry+https://github.com/rust-lang/crates.io-index" 1957 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1958 | 1959 | [[package]] 1960 | name = "windows_i686_gnu" 1961 | version = "0.48.5" 1962 | source = "registry+https://github.com/rust-lang/crates.io-index" 1963 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1964 | 1965 | [[package]] 1966 | name = "windows_i686_gnu" 1967 | version = "0.52.6" 1968 | source = "registry+https://github.com/rust-lang/crates.io-index" 1969 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1970 | 1971 | [[package]] 1972 | name = "windows_i686_gnullvm" 1973 | version = "0.52.6" 1974 | source = "registry+https://github.com/rust-lang/crates.io-index" 1975 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1976 | 1977 | [[package]] 1978 | name = "windows_i686_msvc" 1979 | version = "0.48.5" 1980 | source = "registry+https://github.com/rust-lang/crates.io-index" 1981 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1982 | 1983 | [[package]] 1984 | name = "windows_i686_msvc" 1985 | version = "0.52.6" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1988 | 1989 | [[package]] 1990 | name = "windows_x86_64_gnu" 1991 | version = "0.48.5" 1992 | source = "registry+https://github.com/rust-lang/crates.io-index" 1993 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1994 | 1995 | [[package]] 1996 | name = "windows_x86_64_gnu" 1997 | version = "0.52.6" 1998 | source = "registry+https://github.com/rust-lang/crates.io-index" 1999 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 2000 | 2001 | [[package]] 2002 | name = "windows_x86_64_gnullvm" 2003 | version = "0.48.5" 2004 | source = "registry+https://github.com/rust-lang/crates.io-index" 2005 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 2006 | 2007 | [[package]] 2008 | name = "windows_x86_64_gnullvm" 2009 | version = "0.52.6" 2010 | source = "registry+https://github.com/rust-lang/crates.io-index" 2011 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 2012 | 2013 | [[package]] 2014 | name = "windows_x86_64_msvc" 2015 | version = "0.48.5" 2016 | source = "registry+https://github.com/rust-lang/crates.io-index" 2017 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 2018 | 2019 | [[package]] 2020 | name = "windows_x86_64_msvc" 2021 | version = "0.52.6" 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" 2023 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 2024 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nu_plugin_regex" 3 | version = "0.13.0" 4 | authors = ["Darren Schroeder"] 5 | edition = "2021" 6 | repository = "https://github.com/fdncred/nu_plugin_regex" 7 | description = "nu plugin to search text with regex" 8 | license = "MIT" 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [dependencies] 13 | # nushell dependencies 14 | nu-plugin = "0.104.0" 15 | nu-protocol = "0.104.0" 16 | nu-path = "0.104.0" 17 | 18 | # for local development, you can use a path dependency 19 | # nu-plugin = { path = "../nushell/crates/nu-plugin", version = "0.98.0" } 20 | # nu-protocol = { path = "../nushell/crates/nu-protocol", version = "0.98.0" } 21 | # nu-path = { path = "../nushell/crates/nu-path", version = "0.98.0" } 22 | 23 | fancy-regex = "0.14.0" 24 | 25 | [dev-dependencies] 26 | nu-plugin-test-support = "0.104.0" 27 | # nu-plugin-test-support = { path = "../nushell/crates/nu-plugin-test-support" } 28 | 29 | [profile.release] 30 | opt-level = "s" # Optimize for size 31 | strip = "debuginfo" 32 | lto = "thin" 33 | 34 | [profile.dev] 35 | opt-level = 0 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 - 2022 The Nushell Project Developers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # nu_plugin_regex 2 | 3 | This is a nushell plugin to parse regular expressions. 4 | 5 | # Examples 6 | 7 | ## Example 1 - match digits one or more times 8 | ```nushell 9 | 'abc123abc' | regex '\d+' 10 | ``` 11 | ```console 12 | ╭───┬───────────┬───────┬───────┬─────╮ 13 | │ # │ input │ match │ begin │ end │ 14 | ├───┼───────────┼───────┼───────┼─────┤ 15 | │ 0 │ abc123abc │ 123 │ 3 │ 6 │ 16 | ╰───┴───────────┴───────┴───────┴─────╯ 17 | ``` 18 | ## Example 2 - match single character in a list 19 | ```nushell 20 | 'abc123abc' | regex '[a-c]' 21 | ``` 22 | ```console 23 | ╭───┬───────────┬───────┬───────┬─────╮ 24 | │ # │ input │ match │ begin │ end │ 25 | ├───┼───────────┼───────┼───────┼─────┤ 26 | │ 0 │ abc123abc │ a │ 0 │ 1 │ 27 | │ 1 │ abc123abc │ b │ 1 │ 2 │ 28 | │ 2 │ abc123abc │ c │ 2 │ 3 │ 29 | │ 3 │ abc123abc │ a │ 6 │ 7 │ 30 | │ 4 │ abc123abc │ b │ 7 │ 8 │ 31 | │ 5 │ abc123abc │ c │ 8 │ 9 │ 32 | ╰───┴───────────┴───────┴───────┴─────╯ 33 | ``` 34 | ## Example 3 - match any word character one or more times 35 | ```nushell 36 | 'abc123abc' | regex '\w+' 37 | ``` 38 | ```console 39 | ╭───┬───────────┬───────────┬───────┬─────╮ 40 | │ # │ input │ match │ begin │ end │ 41 | ├───┼───────────┼───────────┼───────┼─────┤ 42 | │ 0 │ abc123abc │ abc123abc │ 0 │ 9 │ 43 | ╰───┴───────────┴───────────┴───────┴─────╯ 44 | ``` 45 | ## Example 4 - match the output of `ls` with a list of characters 46 | ```nushell 47 | ls | each {|e| $e.name | regex '[Cc]'} | flatten 48 | ``` 49 | ```console 50 | ╭────┬─────────────────────────────┬───────┬───────┬─────╮ 51 | │ # │ input │ match │ begin │ end │ 52 | ├────┼─────────────────────────────┼───────┼───────┼─────┤ 53 | │ 0 │ .cargo │ c │ 1 │ 2 │ 54 | │ 1 │ .vscode │ c │ 3 │ 4 │ 55 | │ 2 │ CODE_OF_CONDUCT.md │ C │ 0 │ 1 │ 56 | │ 3 │ CODE_OF_CONDUCT.md │ C │ 8 │ 9 │ 57 | │ 4 │ CODE_OF_CONDUCT.md │ C │ 13 │ 14 │ 58 | │ 5 │ CONTRIBUTING.md │ C │ 0 │ 1 │ 59 | │ 6 │ Cargo.lock │ C │ 0 │ 1 │ 60 | │ 7 │ Cargo.lock │ c │ 8 │ 9 │ 61 | │ 8 │ Cargo.toml │ C │ 0 │ 1 │ 62 | │ 9 │ LICENSE │ C │ 2 │ 3 │ 63 | │ 10 │ VSWorkspaceSettings.json │ c │ 9 │ 10 │ 64 | │ 11 │ build-all-maclin.sh │ c │ 12 │ 13 │ 65 | │ 12 │ build-all-windows.cmd │ c │ 18 │ 19 │ 66 | │ 13 │ crates │ c │ 0 │ 1 │ 67 | │ 14 │ docker │ c │ 2 │ 3 │ 68 | │ 15 │ docs │ c │ 2 │ 3 │ 69 | │ 16 │ rust-toolchain.toml │ c │ 9 │ 10 │ 70 | │ 17 │ src │ c │ 2 │ 3 │ 71 | │ 18 │ unstable_cargo_features.txt │ c │ 9 │ 10 │ 72 | ╰────┴─────────────────────────────┴───────┴───────┴─────╯ 73 | ``` 74 | ## Example 5 - match with 2 unnamed capture groups 75 | ```nushell 76 | 'abc123abc' | regex '(\w{3})(\d{3})' 77 | ``` 78 | ```console 79 | ╭───┬───────────┬──────────────┬────────┬───────┬─────╮ 80 | │ # │ input │ capture_name │ match │ begin │ end │ 81 | ├───┼───────────┼──────────────┼────────┼───────┼─────┤ 82 | │ 0 │ abc123abc │ capgrp0 │ abc123 │ 0 │ 6 │ 83 | │ 1 │ abc123abc │ capgrp1 │ abc │ 0 │ 3 │ 84 | │ 2 │ abc123abc │ capgrp2 │ 123 │ 3 │ 6 │ 85 | ╰───┴───────────┴──────────────┴────────┴───────┴─────╯ 86 | ``` 87 | ## Example 6 - match with 2 named capture groups 88 | ```nushell 89 | 'abc123abc' | regex '(?\w{3})(?\d{3})' 90 | ``` 91 | ```console 92 | ╭───┬───────────┬──────────────┬────────┬───────┬─────╮ 93 | │ # │ input │ capture_name │ match │ begin │ end │ 94 | ├───┼───────────┼──────────────┼────────┼───────┼─────┤ 95 | │ 0 │ abc123abc │ capgrp0 │ abc123 │ 0 │ 6 │ 96 | │ 1 │ abc123abc │ word │ abc │ 0 │ 3 │ 97 | │ 2 │ abc123abc │ num │ 123 │ 3 │ 6 │ 98 | ╰───┴───────────┴──────────────┴────────┴───────┴─────╯ 99 | ``` 100 | ## Example 7 - match with 2 named capture groups and 1 unnamed capture group 101 | ```nushell 102 | 'abc123abc' | regex '(?\w{3})(?\d{3})(\w{3})' 103 | ``` 104 | ```console 105 | ╭───┬───────────┬──────────────┬───────────┬───────┬─────╮ 106 | │ # │ input │ capture_name │ match │ begin │ end │ 107 | ├───┼───────────┼──────────────┼───────────┼───────┼─────┤ 108 | │ 0 │ abc123abc │ capgrp0 │ abc123abc │ 0 │ 9 │ 109 | │ 1 │ abc123abc │ word │ abc │ 0 │ 3 │ 110 | │ 2 │ abc123abc │ num │ 123 │ 3 │ 6 │ 111 | │ 3 │ abc123abc │ capgrp3 │ abc │ 6 │ 9 │ 112 | ╰───┴───────────┴──────────────┴───────────┴───────┴─────╯ 113 | ``` 114 | ## Example 8 - match non-digits, digits, non-digits with unnamed capture groups 115 | ```nushell 116 | 'abc123abc' | regex '(\D+)(\d+)(\D+)' 117 | ``` 118 | ```console 119 | ╭───┬───────────┬──────────────┬───────────┬───────┬─────╮ 120 | │ # │ input │ capture_name │ match │ begin │ end │ 121 | ├───┼───────────┼──────────────┼───────────┼───────┼─────┤ 122 | │ 0 │ abc123abc │ capgrp0 │ abc123abc │ 0 │ 9 │ 123 | │ 1 │ abc123abc │ capgrp1 │ abc │ 0 │ 3 │ 124 | │ 2 │ abc123abc │ capgrp2 │ 123 │ 3 │ 6 │ 125 | │ 3 │ abc123abc │ capgrp3 │ abc │ 6 │ 9 │ 126 | ╰───┴───────────┴──────────────┴───────────┴───────┴─────╯ 127 | ``` 128 | # Notes 129 | 130 | - capture group 0 is always reported when groups are detected. not sure if this is right. this was mainly done for example 7 131 | - results should match https://regex101.com/ 132 | 133 | ## Character Classes 134 | 135 | | Class | Description | 136 | |-|-| 137 | | `.` | Any character | 138 | | `\d` | Any digit | 139 | | `\D` | Any non-digit | 140 | | `\w` | Any alphanumeric (Latin letters, digits, underscore) | 141 | | `\W` | Any non-alphanumeric (All but \w) | 142 | | `\s` | White space | 143 | | `\S` | Non-white space | 144 | | `\t` | Horizontal tab | 145 | | `\r` | Carriage return | 146 | | `\n` | Line feed | 147 | | `\v` | Vertical tab | 148 | | `\f` | Form feed | 149 | | `^` | The beginning of text (or start-of-line with |multi-line mode) 150 | | `$` | The end of text (or end-of-line with multi-line mode) | 151 | | `\A` | Only the beginning of text (even with multi-line mode |enabled) 152 | | `\z` | Only the end of text (even with multi-line mode |enabled) 153 | | `\b` | A Unicode word boundary (\w on one side and \W, \A, |or \z on other) 154 | | `\B` | Not a Unicode word boundary | 155 | | `\pN` | One letter name for Unicode character class | 156 | | `\PN` | Negated one-letter name Unicode character class | 157 | | `[xyz]` | Either x, y or z | 158 | | `[^xyz]` | Any character except x, y or z | 159 | | `[a-z]` | Any character in range a-z | 160 | | `[[:^alpha:]]` | Negated (\[^A-Za-z\]) | 161 | | `[[:alnum:]]` | alphanumeric (\[0-9A-Za-z\]) | 162 | | `[[:alpha:]]` | alphabetic (\[A-Za-z\]) | 163 | | `[[:ascii:]]` | ASCII (\[\x00-\x7F\]) | 164 | | `[[:blank:]]` | blank (\[\t \]) | 165 | | `[[:cntrl:]]` | control (\[\x00-\x1F\x7F\]) | 166 | | `[[:digit:]]` | digits (\[0-9\]) | 167 | | `[[:graph:]]` | graphical (\[!-~\]) | 168 | | `[[:lower:]]` | lower case (\[a-z\]) | 169 | | `[[:print:]]` | printable (\[ -~\]) | 170 | | `[[:punct:]]` | punctuation (\[!-/:-@\[-`{-~\]) | 171 | | `[[:space:]]` | whitespace (\[\t\n\v\f\r \]) | 172 | | `[[:upper:]]` | upper case (\[A-Z\]) | 173 | | `[[:word:]]` | word characters (\[0-9A-Za-z_\]) | 174 | | `[[:xdigit:]]` | hex digit (\[0-9A-Fa-f\]) | 175 | 176 | ## Grouping and flags 177 | ``` 178 | (exp) numbered capture group (indexed by opening parenthesis) 179 | (?Pexp) named (also numbered) capture group (allowed chars: [_0-9a-zA-Z.\[\]]) 180 | (?:exp) non-capturing group 181 | (?flags) set flags within current group 182 | (?flags:exp) set flags for exp (non-capturing) 183 | ``` 184 | Flags are each a single character. For example, (?x) sets the flag x and (?-x) clears the flag x. Multiple flags can be set or cleared at the same time: (?xy) sets both the x and y flags and (?x-y) sets the x flag and clears the y flag. 185 | 186 | All flags are by default disabled unless stated otherwise. They are: 187 | ``` 188 | i case-insensitive: letters match both upper and lower case 189 | m multi-line mode: ^ and $ match begin/end of line 190 | s allow . to match \n 191 | U swap the meaning of x* and x*? 192 | u Unicode support (enabled by default) 193 | x ignore whitespace and allow line comments (starting with `#`) 194 | ``` 195 | 196 | ## Escape Sequences 197 | ``` 198 | \* literal *, works for any punctuation character: \.+*?()|[]{}^$ 199 | \a bell (\x07) 200 | \f form feed (\x0C) 201 | \t horizontal tab 202 | \n new line 203 | \r carriage return 204 | \v vertical tab (\x0B) 205 | \123 octal character code (up to three digits) (when enabled) 206 | \x7F hex character code (exactly two digits) 207 | \x{10FFFF} any hex character code corresponding to a Unicode code point 208 | \u007F hex character code (exactly four digits) 209 | \u{7F} any hex character code corresponding to a Unicode code point 210 | \U0000007F hex character code (exactly eight digits) 211 | \U{7F} any hex character code corresponding to a Unicode code point 212 | 213 | \h : hex digit ([0-9A-Fa-f]) 214 | \H : not hex digit ([^0-9A-Fa-f]) 215 | \e : escape control character (\x1B) 216 | \K : keep text matched so far out of the overall match 217 | \G : anchor to where the previous match ended 218 | ``` 219 | 220 | ## Backreferences 221 | ``` 222 | \1 : match the exact string that the first capture group matched 223 | \2 : backref to the second capture group, etc 224 | ``` 225 | 226 | ## Named Capture Groups 227 | ``` 228 | (?exp) : match exp, creating capture group named name 229 | \k : match the exact string that the capture group named name matched 230 | (?Pexp) : same as (?exp) for compatibility with Python, etc. 231 | (?P=name) : same as \k for compatibility with Python, etc. 232 | 233 | Look-around assertions for matching without changing the current position: 234 | 235 | (?=exp) : look-ahead, succeeds if exp matches to the right of the current position 236 | (?!exp) : negative look-ahead, succeeds if exp doesn’t match to the right 237 | (?<=exp) : look-behind, succeeds if exp matches to the left of the current position 238 | (? String { 13 | env!("CARGO_PKG_VERSION").into() 14 | } 15 | 16 | fn commands(&self) -> Vec>> { 17 | vec![Box::new(Regex_)] 18 | } 19 | } 20 | 21 | struct Regex_; 22 | 23 | impl SimplePluginCommand for Regex_ { 24 | type Plugin = RegExPlugin; 25 | 26 | fn name(&self) -> &str { 27 | "regex" 28 | } 29 | 30 | fn description(&self) -> &str { 31 | "Parse input with a regular expression and display the results." 32 | } 33 | 34 | fn signature(&self) -> Signature { 35 | Signature::build(PluginCommand::name(self)) 36 | .required( 37 | "pattern", 38 | SyntaxShape::String, 39 | "the regular expression to use", 40 | ) 41 | .allow_variants_without_examples(true) 42 | .input_output_types(vec![(Type::String, Type::table())]) 43 | .category(Category::Experimental) 44 | } 45 | 46 | fn examples(&self) -> Vec { 47 | vec![Example { 48 | description: "Parse a string with a regular expression".into(), 49 | example: r#""hello world" | regex '(?P\w+) (?P\w+)'"#.into(), 50 | result: None, 51 | }] 52 | } 53 | 54 | fn run( 55 | &self, 56 | _config: &RegExPlugin, 57 | _engine: &EngineInterface, 58 | call: &EvaluatedCall, 59 | input: &Value, 60 | ) -> Result { 61 | let pattern: Spanned = call.req(0)?; 62 | let span = input.span(); 63 | match input { 64 | Value::String { val, .. } => Ok(crate::regex_::regex_from_string( 65 | &pattern.item, 66 | pattern.span, 67 | val, 68 | span, 69 | )?), 70 | v => Err( 71 | LabeledError::new(format!("requires string input, got {}", v.get_type())) 72 | .with_label("Expected string from pipeline", call.head), 73 | ), 74 | } 75 | } 76 | } 77 | 78 | fn main() { 79 | serve_plugin(&RegExPlugin, MsgPackSerializer); 80 | } 81 | -------------------------------------------------------------------------------- /src/regex_.rs: -------------------------------------------------------------------------------- 1 | use fancy_regex::Regex; 2 | use nu_protocol::{record, LabeledError, Span, Value}; 3 | 4 | fn validate_regex(pattern: &str, pattern_span: Span) -> Result { 5 | match Regex::new(pattern) { 6 | Ok(regex) => Ok(regex), 7 | Err(e) => { 8 | Err(LabeledError::new(format!("error: {}", e)) 9 | .with_label("Invalid Regex", pattern_span)) 10 | } 11 | } 12 | } 13 | 14 | pub fn regex_from_string( 15 | pattern: &str, 16 | pattern_span: Span, 17 | val: &str, 18 | value_span: Span, 19 | ) -> Result { 20 | let re = validate_regex(pattern, pattern_span)?; 21 | 22 | let has_capture_groups = !capture_groups(&re, false).is_empty(); 23 | 24 | if has_capture_groups { 25 | let value_result1 = capture_with_groups(&re, val, pattern_span, value_span)?; 26 | Ok(value_result1) 27 | } else { 28 | let value_result2 = capture_without_groups(&re, pattern_span, val, value_span)?; 29 | Ok(value_result2) 30 | } 31 | } 32 | 33 | fn capture_groups(regex: &Regex, with_capture_group_zero: bool) -> Vec { 34 | if with_capture_group_zero { 35 | regex 36 | .capture_names() 37 | .enumerate() 38 | .map(|(i, name)| { 39 | name.map(String::from) 40 | .unwrap_or_else(|| format!("capgrp{}", i)) 41 | }) 42 | .collect() 43 | } else { 44 | regex 45 | .capture_names() 46 | .enumerate() 47 | .skip(1) 48 | .map(|(i, name)| { 49 | name.map(String::from) 50 | .unwrap_or_else(|| format!("capgrp{}", i)) 51 | }) 52 | .collect() 53 | } 54 | } 55 | 56 | fn capture_without_groups( 57 | re: &Regex, 58 | pattern_span: Span, 59 | val: &str, 60 | value_span: Span, 61 | ) -> Result { 62 | let matches = re.find_iter(val); 63 | let mut recs = Vec::new(); 64 | 65 | for match_result in matches { 66 | match match_result { 67 | Ok(a_match) => { 68 | let rec = record!( 69 | "input" => Value::string(val.to_string(), value_span), 70 | "match" => Value::string(a_match.as_str().to_string(),value_span), 71 | "begin" => Value::int(a_match.start() as i64, value_span), 72 | "end" => Value::int(a_match.end() as i64, value_span), 73 | ); 74 | recs.push(Value::record(rec, value_span)); 75 | } 76 | Err(e) => { 77 | return Err(LabeledError::new(format!("error: {}", e)) 78 | .with_label("Invalid Regex", pattern_span)); 79 | } 80 | } 81 | } 82 | 83 | Ok(Value::list(recs, value_span)) 84 | } 85 | 86 | fn capture_with_groups( 87 | re: &Regex, 88 | input: &str, 89 | pattern_span: Span, 90 | value_span: Span, 91 | ) -> Result { 92 | let mut recs: Vec = Vec::new(); 93 | let capture_group_names = capture_groups(re, true); 94 | let capture_matches = re.captures_iter(input); 95 | 96 | for capture_result in capture_matches { 97 | let captures = match capture_result { 98 | Ok(c) => c, 99 | Err(e) => { 100 | return Err(LabeledError::new(format!("error: {}", e)) 101 | .with_label("Error with regular expression captures", pattern_span)); 102 | } 103 | }; 104 | 105 | for (column_name, capture_match) in capture_group_names.iter().zip(captures.iter()) { 106 | let cap_string = capture_match 107 | .map(|v| (input.to_string(), v.as_str(), v.start(), v.end())) 108 | .unwrap_or(("".to_string(), "", 0, 0)); 109 | 110 | let rec = record!( 111 | "input" => Value::string(cap_string.0, value_span), 112 | "capture_name" => Value::string(column_name.clone(), value_span), 113 | "match" => Value::string(cap_string.1.to_string(), value_span), 114 | "begin" => Value::int(cap_string.2 as i64, value_span), 115 | "end" => Value::int(cap_string.3 as i64, value_span), 116 | ); 117 | recs.push(Value::record(rec, value_span)); 118 | } 119 | } 120 | 121 | Ok(Value::list(recs, pattern_span)) 122 | } 123 | --------------------------------------------------------------------------------