https://github.com/rushuiguan/expression
c# expression parser and evaluator
https://github.com/rushuiguan/expression
csharp eval expression parser
Last synced: 8 months ago
JSON representation
c# expression parser and evaluator
- Host: GitHub
- URL: https://github.com/rushuiguan/expression
- Owner: RushuiGuan
- License: mit
- Created: 2015-08-11T02:07:30.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T00:59:56.000Z (about 1 year ago)
- Last Synced: 2025-05-20T20:30:58.495Z (8 months ago)
- Topics: csharp, eval, expression, parser
- Language: C#
- Homepage: https://rushuiguan.github.io/expression
- Size: 1.67 MB
- Stars: 10
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
* v3.0.13
* New operation GetJsonArrayItem
* Provided a json array and an index, the operation will return the array item at the index.
* example 1: GetJsonArrayItem('[1, 2, 3]', 1)
* return value 2
* example 2: GetJsonArrayItem('[1, 2, 3]', 3)
* throw an ArgumentException since array index is out of bound
* v3.0.12
* New operation RegexCapture
* RegexCapture can be used to extract part of a text string using regex pattern and capature groups.
* Operands
1. text to be parsed
2. regex pattern
3. group capture index (optional with the default of 0)
* example 1: RegexCapture('abc123', '[a-z]+(\\d+)', 1)
* returns 123
* example 2: RegexCapture('abc123', '[a-z]+(\\d+)')
* return abc123 because capture index is not specified and 0 is used by default
* example 3: RegexCapture('abc123', '[a-z]+(\\d+)', 3)
* throw an ArgumentException since capture index is out of bound
* 3.0.11
* New operation
* Floor - The Floor operation calls C# Math.Floor. It returns the largest integral value from the input double number.
* Round - The Round operation calls C# Math.Round and use AwayFromZero rounding
* Operands
1. double value to be rounded
2. number of fractional digits in the return value
* UnixTimestamp2DateTime - Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a DateTime value in UTC
* Operands
1. integer: number of seconds that have elapsed since 1970-01-01T00:00:00Z