File: classad-builtin-functions.rst

package info (click to toggle)
condor 23.9.6%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 60,012 kB
  • sloc: cpp: 528,272; perl: 87,066; python: 42,650; ansic: 29,558; sh: 11,271; javascript: 3,479; ada: 2,319; java: 619; makefile: 615; xml: 613; awk: 268; yacc: 78; fortran: 54; csh: 24
file content (1110 lines) | stat: -rw-r--r-- 52,276 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110

Predefined Functions
====================

:index:`expression functions<single: expression functions; ClassAd>`
:index:`ClassAd functions`

Any ClassAd expression may utilize predefined functions. Function names
are case insensitive. Parameters to functions and a return value from a
function may be typed (as given) or not. Nested or recursive function
calls are allowed.

Here are descriptions of each of these predefined functions. The
possible types are the same as itemized in
:ref:`classads/classad-mechanism:classad syntax`. Where the type may
be any of these literal types, it is called out as AnyType. Where the type is
Integer, but only returns the value 1 or 0 (implying ``True`` or
``False``), it is called out as Boolean. The format of each function is
given as

.. code-block:: text

    ReturnType FunctionName(ParameterType parameter1, ParameterType parameter2, ...)

Optional parameters are given within square brackets.
:index:`eval()<single: eval(); ClassAd functions>`
:index:`eval()<single: ClassAd functions; eval()>`

``AnyType eval(AnyType Expr)``
    Evaluates ``Expr`` as a string and then returns the result of
    evaluating the contents of the string as a ClassAd expression. This
    is useful when referring to an attribute such as ``slotX_State``
    where ``X``, the desired slot number is an expression, such as
    ``SlotID+10``. In such a case, if attribute :ad-attr:`SlotID` is 5, the
    value of the attribute ``slot15_State`` can be referenced using the
    expression ``eval(strcat("slot", SlotID+10,"_State"))``. Function
    strcat() calls function string() on the second parameter, which
    evaluates the expression, and then converts the integer result 15 to
    the string ``"15"``. The concatenated string returned by strcat() is
    ``"slot15_State"``, and this string is then evaluated.

    Note that referring to attributes of a job from within the string
    passed to eval() in the ``Requirements`` or ``Rank`` expressions
    could cause inaccuracies in HTCondor's automatic auto-clustering of
    jobs into equivalent groups for matchmaking purposes. This is
    because HTCondor needs to determine which ClassAd attributes are
    significant for matchmaking purposes, and indirect references from
    within the string passed to eval() will not be counted.

:index:`unparse()<single: unparse(); ClassAd functions>`
:index:`unparse()<single: ClassAd functions; unparse()>`

``String unparse(Attribute attr)``
    This function looks up the value of the provided attribute and
    returns the unparsed version as a string. The attribute's value is
    not evaluated. If the attribute's value is ``x + 3``, then the
    function would return the string ``"x + 3"``. If the provided
    attribute cannot be found, an empty string is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given or the argument is not an attribute reference.

:index:`unresolved()<single: unresolved(); ClassAd functions>`
:index:`unresolved()<single: ClassAd functions; unresolved()>`

``String unresolved(Attribute attr)``
    This function returns the external attribute references and unresolved
    attribute references of the expression that is the value of the provided attribute.
    If the provided attribute cannot be found, then ``undefined`` is returned.

    For example, in a typical job ClassAd if the ``Requirements`` expression has the value
    ``OpSys == "LINUX" && TARGET.Arch == "ARM" && Cpus >= RequestCpus``, then 
    ``unresolved(Requirements)`` will return ``"Arch,Cpus,OpSys"`` because those will not
    be attributes of the job ClassAd.

``Boolean unresolved(Attribute attr, String pattern)``
    This function returns ``True`` when at least one of the external or unresolved attribute
    references of the expression that is the value of the provided attribute matches the
    given Perl regular expression pattern.  If none of the references match the pattern, then
    ``False`` is returned. If the provided attribute cannot be found, then ``undefined`` is returned.

    For example, in a typical job ClassAd if the ``Requirements`` expression has the value
    ``OpSys == "LINUX" && Arch == "ARM"``, then ``unresolved(Requirements, "^OpSys")`` will
    return ``True``, and ``unresolved(Requirements, "OpSys.+")`` will return ``False``.

    The intended use of this function is to make it easier to apply a submit transform to
    a job only when the job does not already reference a certain attribute. For instance

..  code-block:: text

    JOB_TRANSFORM_DefPlatform @=end
       # Apply this transform only when the job requirements does not reference OpSysAndver or OpSysName
       REQUIREMENTS ! unresolved(Requirements, "OpSys.+")
       # Add a clause to the job requirements to match only CentOs7 machines
       SET Requirements $(MY.Requirements) && OpSysAndVer == "CentOS7"
    @end

:index:`IfThenElse()<single: IfThenElse(); ClassAd functions>`
:index:`IfThenElse()<single: ClassAd functions; IfThenElse()>`

``AnyType ifThenElse(AnyType IfExpr,AnyType ThenExpr, AnyType ElseExpr)``
    A conditional expression is described by ``IfExpr``. The following
    defines return values, when ``IfExpr`` evaluates to

    -  ``True``. Evaluate and return the value as given by ``ThenExpr``.
    -  ``False``. Evaluate and return the value as given by
       ``ElseExpr``.
    -  ``UNDEFINED``. Return the value ``UNDEFINED``.
    -  ``ERROR``. Return the value ``ERROR``.
    -  ``0.0``. Evaluate, and return the value as given by ``ElseExpr``.
    -  non-``0.0`` Real values. Evaluate, and return the value as given
       by ``ThenExpr``.

    Where ``IfExpr`` evaluates to give a value of type ``String``, the
    function returns the value ``ERROR``. The implementation uses lazy
    evaluation, so expressions are only evaluated as defined.

    This function returns ``ERROR`` if other than exactly 3 arguments
    are given. 

:index:`isUndefined()<single: isUndefined(); ClassAd functions>`
:index:`isUndefined()<single: ClassAd functions; isUndefined()>`

``Boolean isUndefined(AnyType Expr)``
    Returns ``True``, if ``Expr`` evaluates to ``UNDEFINED``. Returns
    ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isError()<single: isError(); ClassAd functions>`
:index:`isError()<single: ClassAd functions; isError()>`

``Boolean isError(AnyType Expr)``
    Returns ``True``, if ``Expr`` evaluates to ``ERROR``. Returns
    ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isString()<single: isString(); ClassAd functions>`
:index:`isString()<single: ClassAd functions; isString()>`

``Boolean isString(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives a value of
    type ``String``. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isInteger()<single: isInteger(); ClassAd functions>`
:index:`isInteger()<single: ClassAd functions; isInteger()>`

``Boolean isInteger(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives a value of
    type ``Integer``. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isReal()<single: isReal(); ClassAd functions>`
:index:`isReal()<single: ClassAd functions; isReal()>`

``Boolean isReal(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives a value of
    type ``Real``. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isList()<single: isList(); ClassAd functions>`
:index:`isList()<single: ClassAd functions; isList()>`

``Boolean isList(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives a value of
    type ``List``. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isClassAd()<single: isClassAd(); ClassAd functions>`
:index:`isClassAd()<single: ClassAd functions; isClassAd()>`

``Boolean isClassAd(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives a value of
    type ``ClassAd``. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isBoolean()<single: isBoolean(); ClassAd functions>`
:index:`isBoolean()<single: ClassAd functions; isBoolean()>`

``Boolean isBoolean(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` gives the integer
    value 0 or 1. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`isAbstime()<single: isAbstime(); ClassAd functions>`
:index:`isAbstime()<single: ClassAd functions; isAbstime()>`

``Boolean isAbstime(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` returns an abstime
    type. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 
    :index:`isRelTime()<single: isRelTime(); ClassAd functions>`

:index:`isReltime()<single: isReltime(); ClassAd functions>`
:index:`isReltime()<single: ClassAd functions; isReltime()>`

``Boolean isReltime(AnyType Expr)``
    Returns ``True``, if the evaluation of ``Expr`` returns an relative time
    type. Returns ``False`` in all other cases.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 


:index:`member()<single: member(); ClassAd functions>`
:index:`member()<single: ClassAd functions; member()>`

``Boolean member(AnyType m, ListType l)``
    Returns error if m does not evalute to a scalar, or l does not
    evaluate to a list.  Otherwise the elements of l are evaluted
    in order, and if an element is equal to m in the sense of ``==``
    the result of the function is ``True``.  Otherwise the function
    returns false.

:index:`anyCompare()<single: anyCompare(); ClassAd functions>`
:index:`anyCompare()<single: ClassAd functions; anyCompare()>`

``Boolean anyCompare(string op, list l, AnyType t)``
    Returns error if op does not evalute to one of ``<``, ``<=``,
    ``==``, ``>``, ``>=``, ``!-``, ``is`` or ``isnt``. Returns error
    if l isn't a list, or t isn't a scalar
    Otherwise the elements of l are evaluted and compared to t
    using the corresponding operator defined by op. If any of
    the members of l evaluate to true, the result is ``True``.
    Otherwise the function returns ``False``.

:index:`allCompare()<single: allCompare(); ClassAd functions>`
:index:`allCompare()<single: ClassAd functions; allCompare()>`

``Boolean allCompare(string op, list l, AnyType t)``
    Returns error if op does not evalute to one of ``<``, ``<=``,
    ``==``, ``>``, ``>=``, ``!-``, ``is`` or ``isnt``. Returns error
    if l isn't a list, or t isn't a scalar
    Otherwise the elements of l are evaluted and compared to t
    using the corresponding operator defined by op. If all of
    the members of l evaluate to true, the result is ``True``.
    Otherwise the function returns ``False``.

:index:`identicalMember()<single: identicalMember(); ClassAd functions>`
:index:`identicalMember()<single: ClassAd functions; identicalMember()>`

``Boolean identicalMember(AnyType m, ListType l)``
    Returns error if m does not evalute to a scalar, or l does not
    evaluate to a list.  Otherwise the elements of l are evaluted
    in order, and if an element is equal to m in the sense of ``=?=``
    the result of the function is ``True``.  Otherwise the function
    returns false.

:index:`int()<single: int(); ClassAd functions>`
:index:`int()<single: ClassAd functions; int()>`

``Integer int(AnyType Expr)``
    Returns the integer value as defined by ``Expr``. Where the type of
    the evaluated ``Expr`` is ``Real``, the value is truncated (round
    towards zero) to an integer. Where the type of the evaluated
    ``Expr`` is ``String``, the string is converted to an integer using
    a C-like atoi() function. When this result is not an integer,
    ``ERROR`` is returned. Where the evaluated ``Expr`` is ``ERROR`` or
    ``UNDEFINED``, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`real()<single: real(); ClassAd functions>`
:index:`real()<single: ClassAd functions; real()>`

``Real real(AnyType Expr)``
    Returns the real value as defined by ``Expr``. Where the type of the
    evaluated ``Expr`` is ``Integer``, the return value is the converted
    integer. Where the type of the evaluated ``Expr`` is ``String``, the
    string is converted to a real value using a C-like atof() function.
    When this result is not a real, ``ERROR`` is returned. Where the
    evaluated ``Expr`` is ``ERROR`` or ``UNDEFINED``, ``ERROR`` is
    returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`string()<single: string(); ClassAd functions>`
:index:`string()<single: ClassAd functions; string()>`

``String string(AnyType Expr)``
    Returns the string that results from the evaluation of ``Expr``.
    Converts a non-string value to a string. Where the evaluated
    ``Expr`` is ``ERROR`` or ``UNDEFINED``, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`bool()<single: bool(); ClassAd functions>`
:index:`bool()<single: ClassAd functions; bool()>`

``Bool bool(AnyType Expr)``
    Returns the boolean that results from the evaluation of ``Expr``.
    Converts a non-boolean value to a bool. A string expression
    that evaluates to the string "true" yields true, and "false" returns

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`absTime()<single: absTime(); ClassAd functions>`
:index:`absTime()<single: ClassAd functions; absTime()>`

``AbsTime absTime(AnyType t [, int z])``
    Creates an AbsTime value corresponding to time t an time-zone offset z. 
    If t is a String, then z must be omitted, and t is parsed as a specification as follows.

    The operand t is parsed as a specification of an instant in time (date and time). 
    This function accepts the canonical native representation of AbsTime values, but
    minor variations in format are allowed.
    The default format is yyyy-mm-ddThh:mm:sszzzzz where zzzzz is a time zone in the 
    format +hh:mm or -hh:mm

    If t and z are both omitted, the result is an AbsTime value representing the time and
    place where the function call is evaluated. Otherwise, t is converted to a Real by the function “real”,
    and treated as a number of seconds from the epoch, Midnight January 1, 1970 UTC. If z is
    specified, it is treated as a number of seconds east of Greenwich. Otherwise, the offset is calculated
    from t according to the local rules for the place where the function is evaluated.

:index:`relTime()<single: relTime(); ClassAd functions>`
:index:`relTime()<single: ClassAd functions; relTime()>`

``RelTime relTime(AnyType t)``
     If the operand t is a String, it is parsed as a specification of a
     time interval. This function accepts the canonical native representation of RelTime values, but minor
     variations in format are allowed.

     Otherwise, t is converted to a Real by the function real, and treated as a number of seconds.
     The default string format is [-]days+hh:mm:ss.fff, where leading components and the fraction .fff
     are omitted if they are zero. In the default syntax, days is a sequence of digits starting with a non-zero
     digit, hh, mm, and ss are strings of exactly two digits (padded on the left with zeros if necessary) with
     values less than 24, 60, and 60, respectively and fff is a string of exactly three digits.


:index:`floor()<single: floor(); ClassAd functions>`
:index:`floor()<single: ClassAd functions; floor()>`

``Integer floor(AnyType Expr)``
    Returns the integer that results from the evaluation of ``Expr``,
    where the type of the evaluated ``Expr`` is ``Integer``. Where the
    type of the evaluated ``Expr`` is not ``Integer``, function
    ``real(Expr)`` is called. Its return value is then used to return
    the largest magnitude integer that is not larger than the returned
    value. Where ``real(Expr)`` returns ``ERROR`` or ``UNDEFINED``,
    ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`ceiling()<single: ceiling(); ClassAd functions>`
:index:`ceiling()<single: ClassAd functions; ceiling()>`

``Integer ceiling(AnyType Expr)``
    Returns the integer that results from the evaluation of ``Expr``,
    where the type of the evaluated ``Expr`` is ``Integer``. Where the
    type of the evaluated ``Expr`` is not ``Integer``, function
    ``real(Expr)`` is called. Its return value is then used to return
    the smallest magnitude integer that is not less than the returned
    value. Where ``real(Expr)`` returns ``ERROR`` or ``UNDEFINED``,
    ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`pow()<single: pow(); ClassAd functions>`
:index:`pow()<single: ClassAd functions; pow()>`

``Integer pow(Integer base, Integer exponent)`` OR ``Real pow(Integer base, Integer exponent)`` OR ``Real pow(Real base, Real exponent)``
    Calculates ``base`` raised to the power of ``exponent``. If
    ``exponent`` is an integer value greater than or equal to 0, and
    ``base`` is an integer, then an integer value is returned. If
    ``exponent`` is an integer value less than 0, or if either ``base``
    or ``exponent`` is a real, then a real value is returned. An
    invocation with ``exponent=0`` or ``exponent=0.0``, for any value of
    ``base``, including 0 or 0.0, returns the value 1 or 1.0, type
    appropriate. 

:index:`quantize()<single: quantize(); ClassAd functions>`
:index:`quantize()<single: ClassAd functions; quantize()>`

``Integer quantize(AnyType a, Integer b)`` OR ``Real quantize(AnyType a, Real b)`` OR ``AnyType quantize(AnyType a, AnyType list b)``
    ``quantize()`` computes the quotient of ``a/b``, in order to further
    compute ``  ceiling(quotient) * b``. This computes and returns an
    integral multiple of ``b`` that is at least as large as ``a``. So,
    when ``b >= a``, the return value will be ``b``. The return type is
    the same as that of ``b``, where ``b`` is an Integer or Real.

    When ``b`` is a list, ``quantize()`` returns the first value in the
    list that is greater than or equal to ``a``. When no value in the
    list is greater than or equal to ``a``, this computes and returns an
    integral multiple of the last member in the list that is at least as
    large as ``a``.

    This function returns ``ERROR`` if ``a`` or ``b``, or a member of
    the list that must be considered is not an Integer or Real.

    Here are examples:

    .. code-block:: text

             8     = quantize(3, 8)
             4     = quantize(3, 2)
             0     = quantize(0, 4)
             6.8   = quantize(1.5, 6.8)
             7.2   = quantize(6.8, 1.2)
             10.2  = quantize(10, 5.1)

             4     = quantize(0, {4})
             2     = quantize(2, {1, 2, "A"})
             3.0   = quantize(3, {1, 2, 0.5})
             3.0   = quantize(2.7, {1, 2, 0.5})
             ERROR = quantize(3, {1, 2, "A"})


:index:`round()<single: round(); ClassAd functions>`
:index:`round()<single: ClassAd functions; round()>`

``Integer round(AnyType Expr)``
    Returns the integer that results from the evaluation of ``Expr``,
    where the type of the evaluated ``Expr`` is ``Integer``. Where the
    type of the evaluated ``Expr`` is not ``Integer``, function
    ``real(Expr)`` is called. Its return value is then used to return
    the integer that results from a round-to-nearest rounding method.
    The nearest integer value to the return value is returned, except in
    the case of the value at the exact midpoint between two integer
    values. In this case, the even valued integer is returned. Where
    ``real(Expr)`` returns ``ERROR`` or ``UNDEFINED``, or the integer
    value does not fit into 32 bits, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`random()<single: random(); ClassAd functions>`
:index:`random()<single: ClassAd functions; random()>`

``Integer random([ AnyType Expr ])``
    Where the optional argument ``Expr`` evaluates to type ``Integer``
    or type ``Real`` (and called ``x``), the return value is the integer
    or real ``r`` randomly chosen from the interval ``0 <= r < x``. With
    no argument, the return value is chosen with ``random(1.0)``.
    Returns ``ERROR`` in all other cases.

    This function returns ``ERROR`` if greater than 1 argument is given.
    
:index:`sum()<single: sum(); ClassAd functions>`
:index:`sum()<single: ClassAd functions; sum()>`

``Number sum([ List l ])``
    The elements of l are evaluated, producing a list l of values. Undefined values
    are removed. If the resulting l is composed only of numbers, the result is the sum of the values,
    as a Real if any value is Real, and as an Integer otherwise. If the 
    list is empty, the result is 0. If the list has only Undefined values, the result
    is ``UNDEFINED``. In other cases, the result is ``ERROR``.

    This function returns ``ERROR`` if greater than 1 argument is given.
    
:index:`avg()<single: avg(); ClassAd functions>`
:index:`avg()<single: ClassAd functions; avg()>`

``Number avg([ List l ])``
    The elements of l are evaluated, producing a list l of values. Undefined values
    are removed. If the resulting l is composed only of numbers, the result is the average of the values,
    as a Real. If the list is empty, the result is 0.
    If the list has only Undefined values, the result is ``UNDEFINED``.
    In other cases,  the result is ERROR.
    
:index:`min()<single: min(); ClassAd functions>`
:index:`min()<single: ClassAd functions; min()>`

``Number min([ List l ])``
    The elements of l are evaluated, producing a list l of values.
    Undefined values are removed.
    If the resulting l is composed only of numbers, the result is the minimum of the values,
    as a Real if any value is Real, and as an Integer otherwise. If the list 
    is empty, the result is UNDEFINED. In other cases, the result is ERROR.
    
:index:`max()<single: max(); ClassAd functions>`
:index:`max()<single: ClassAd functions; max()>`

``Number max([ List l ])``
    The elements of l are evaluated, producing a list l of values.
    Undefined values are removed.
    If the resulting l is composed only of numbers, the result is the maximum of the values,
    as a Real if any value is Real, and as an Integer otherwise. If the list 
    is empty, the result is UNDEFINED. In other cases, the result is ERROR.
    
:index:`strcat()<single: strcat(); ClassAd functions>`
:index:`strcat()<single: ClassAd functions; strcat()>`

``String strcat(AnyType Expr1 [ , AnyType Expr2 ...])``
    Returns the string which is the concatenation of all arguments,
    where all arguments are converted to type ``String`` by function
    ``string(Expr)``. Returns ``ERROR`` if any argument evaluates to
    ``UNDEFINED`` or ``ERROR``.
    
:index:`join()<single: join(); ClassAd functions>`
:index:`join()<single: ClassAd functions; join()>`

``String join(String sep, AnyType Expr1 [ , AnyType Expr2 ...])`` OR ``String join(String sep, List list`` OR ``String join(List list``
    Returns the string which is the concatenation of all arguments after
    the first one. The first argument is the separator, and it is
    inserted between each of the other arguments during concatenation.
    All arguments which are not undefined are converted to type ``String`` by function
    ``string(Expr)`` before concatenation. Undefined arguments are skipped.
    When there are exactly two arguments, If the second argument is a List, all members of the list
    are converted to strings and then joined using the separator. When
    there is only one argument, and the argument is a List, all members
    of the list are converted to strings and then concatenated.

    Returns ``ERROR`` if any argument evaluates to ``UNDEFINED`` or
    ``ERROR``.

    For example:

    .. code-block:: text

            "a, b, c" = join(", ", "a", "b", "c")
            "abc"   = join(split("a b c"))
            "a;b;c" = join(";", split("a b c"))

    
:index:`substr()<single: substr(); ClassAd functions>`
:index:`substr()<single: ClassAd functions; substr()>`

``String substr(String s, Integer offset [ , Integer length ])``
    Returns the substring of ``s``, from the position indicated by
    ``offset``, with (optional) ``length`` characters. The first
    character within ``s`` is at offset 0. If the optional ``length``
    argument is not present, the substring extends to the end of the
    string. If ``offset`` is negative, the value ``(length - offset)``
    is used for the offset. If ``length`` is negative, an initial
    substring is computed, from the offset to the end of the string.
    Then, the absolute value of ``length`` characters are deleted from
    the right end of the initial substring. Further, where characters of
    this resulting substring lie outside the original string, the part
    that lies within the original string is returned. If the substring
    lies completely outside of the original string, the null string is
    returned.

    This function returns ``ERROR`` if greater than 3 or less than 2
    arguments are given. 

:index:`strcmp()<single: strcmp(); ClassAd functions>`
:index:`strcmp()<single: ClassAd functions; strcmp()>`

``Integer strcmp(AnyType Expr1, AnyType Expr2)``
    Both arguments are converted to type ``String`` by function
    ``string(Expr)``. The return value is an integer that will be

    -  less than 0, if ``Expr1`` is lexicographically less than
       ``Expr2``
    -  equal to 0, if ``Expr1`` is lexicographically equal to ``Expr2``
    -  greater than 0, if ``Expr1`` is lexicographically greater than
       ``Expr2``

    Case is significant in the comparison. Where either argument
    evaluates to ``ERROR`` or ``UNDEFINED``, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than 2 arguments are given.

:index:`stricmp()<single: stricmp(); ClassAd functions>`
:index:`stricmp()<single: ClassAd functions; stricmp()>`

``Integer stricmp(AnyType Expr1, AnyType Expr2)``
    This function is the same as ``strcmp``, except that letter case is
    not significant.

:index:`versioncmp()<single: versioncmp(); ClassAd functions>`
:index:`versioncmp()<single: ClassAd functions; versioncmp()>`

``Integer versioncmp(String left, String right)``
    This function version-compares two strings.  It returns an integer

    - less than zero if ``left`` is an earlier version than ``right``
    - zero if the strings are identical
    - more than zero if ``left`` is a later version than ``right``.

    A version comparison is a lexicographic comparison unless the first
    difference between the two strings occurs in a string of digits, in
    which case, sort by the value of that number (assuming that more
    leading zeroes mean smaller numbers).  Thus ``7.x`` is earlier than
    ``7.y``, ``7.9`` is earlier than ``7.10``, and the following sequence
    is in order: ``000, 00, 01, 010, 09, 0, 1, 9, 10``.

:index:`versionGT()<single: ClassAd functions; versionGT()>`
:index:`versionLT()<single: ClassAd functions; versionLT()>`
:index:`versionGE()<single: ClassAd functions; versionGE()>`
:index:`versionLE()<single: ClassAd functions; versionLE()>`
:index:`versionEQ()<single: ClassAd functions; versionEQ()>`

``Boolean versionGT(String left, String right)``
``Boolean versionLT(String left, String right)``
``Boolean versionGE(String left, String right)``
``Boolean versionLE(String left, String right)``
``Boolean versionEQ(String left, String right)``

    As ``versioncmp()`` (above), but for a specific comparison and returning
    a boolean.  The two letter codes stand for "Greater Than", "Less Than",
    "Greater than or Equal", "Less than or Equal", and "EQual", respectively.


:index:`version_in_range()<single: version_in_range(); ClassAd functions>`
:index:`version_in_range()<single: ClassAd functions; version_in_range()>`

``Boolean version_in_range(String version, String min, String max)``

    Equivalent to ``versionLE(min, version) && versionLE(version, max)``.

:index:`toUpper()<single: toUpper(); ClassAd functions>`
:index:`toUpper()<single: ClassAd functions; toUpper()>`

``String toUpper(AnyType Expr)``
    The single argument is converted to type ``String`` by function
    ``string(Expr)``. The return value is this string, with all lower
    case letters converted to upper case. If the argument evaluates to
    ``ERROR`` or ``UNDEFINED``, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`toLower()<single: toLower(); ClassAd functions>`
:index:`toLower()<single: ClassAd functions; toLower()>`

``String toLower(AnyType Expr)``
    The single argument is converted to type ``String`` by function
    ``string(Expr)``. The return value is this string, with all upper
    case letters converted to lower case. If the argument evaluates to
    ``ERROR`` or ``UNDEFINED``, ``ERROR`` is returned.

    This function returns ``ERROR`` if other than exactly 1 argument is
    given. 

:index:`size()<single: size(); ClassAd functions>`
:index:`size()<single: ClassAd functions; size()>`

``Integer size(AnyType Expr)``
    If Expr evaluates to a string, return the number of characters in the string.
    If Expr evaluate to a list, return the number of elements in the list.
    If Expr evaluate to a classad, return the number of entries in the ad.
    Otherwise, ``ERROR`` is returned.

:index:`split()<single: split(); ClassAd functions>`
:index:`split()<single: ClassAd functions; split()>`

``List split(String s [ , String tokens ] )``
    Returns a list of the substrings of ``s`` that have been split up by
    using any of the characters within string ``tokens``. If ``tokens``
    is not specified, then all white space characters are used to
    delimit the string.
    
:index:`splitUserName()<single: splitUserName(); ClassAd functions>`
:index:`splitUserName()<single: ClassAd functions; splitUserName()>`

``List splitUserName(String Name)``
    Returns a list of two strings. Where ``Name`` includes an ``@``
    character, the first string in the list will be the substring that
    comes before the ``@`` character, and the second string in the list
    will be the substring that comes after. Thus, if ``Name`` is
    ``"user@domain"``, then the returned list will be
    {"user", "domain"}. If there is no ``@`` character in ``Name``, then
    the first string in the list will be ``Name``, and the second string
    in the list will be the empty string. Thus, if ``Name`` is
    ``"username"``, then the returned list will be {"username", ""}.
    
:index:`splitSlotName()<single: splitSlotName(); ClassAd functions>`
:index:`splitSlotName()<single: ClassAd functions; splitSlotName()>`

``List splitSlotName(String Name)``
    Returns a list of two strings. Where ``Name`` includes an ``@``
    character, the first string in the list will be the substring that
    comes before the ``@`` character, and the second string in the list
    will be the substring that comes after. Thus, if ``Name`` is
    ``"slot1@machine"``, then the returned list will be
    {"slot1", "machine"}. If there is no ``@`` character in ``Name``,
    then the first string in the list will be the empty string, and the
    second string in the list will be ``Name``, Thus, if ``Name`` is
    ``"machinename"``, then the returned list will be
    {"", "machinename"}. 

:index:`time()<single: time(); ClassAd functions>`
:index:`time()<single: ClassAd functions; time()>`

``Integer time()``
    Returns the current coordinated universal time. This is the time, in
    seconds, since midnight of January 1, 1970.
    
:index:`formatTime()<single: formatTime(); ClassAd functions>`
:index:`formatTime()<single: ClassAd functions; formatTime()>`

``String formatTime([ Integer time ] [ , String format ])``
    Returns a formatted string that is a representation of ``time``. The
    argument ``time`` is interpreted as coordinated universal time in
    seconds, since midnight of January 1, 1970. If not specified,
    ``time`` will default to the current time.

    The argument ``format`` is interpreted similarly to the format
    argument of the ANSI C strftime function. It consists of arbitrary
    text plus placeholders for elements of the time. These placeholders
    are percent signs (%) followed by a single letter. To have a percent
    sign in the output, use a double percent sign (%%). If ``format`` is
    not specified, it defaults to ``%c``.

    Because the implementation uses strftime() to implement this, and
    some versions implement extra, non-ANSI C options, the exact options
    available to an implementation may vary. An implementation is only
    required to implement the ANSI C options, which are:

     ``%a``
        abbreviated weekday name
     ``%A``
        full weekday name
     ``%b``
        abbreviated month name
     ``%B``
        full month name
     ``%c``
        local date and time representation
     ``%d``
        day of the month (01-31)
     ``%H``
        hour in the 24-hour clock (0-23)
     ``%I``
        hour in the 12-hour clock (01-12)
     ``%j``
        day of the year (001-366)
     ``%m``
        month (01-12)
     ``%M``
        minute (00-59)
     ``%p``
        local equivalent of AM or PM
     ``%S``
        second (00-59)
     ``%U``
        week number of the year (Sunday as first day of week) (00-53)
     ``%w``
        weekday (0-6, Sunday is 0)
     ``%W``
        week number of the year (Monday as first day of week) (00-53)
     ``%x``
        local date representation
     ``%X``
        local time representation
     ``%y``
        year without century (00-99)
     ``%Y``
        year with century
     ``%Z``
        time zone name, if any

    
:index:`interval()<single: interval(); ClassAd functions>`
:index:`interval()<single: ClassAd functions; interval()>`

``String interval(Integer seconds)``
    Uses ``seconds`` to return a string of the form ``days+hh:mm:ss``.
    This represents an interval of time. Leading values that are zero
    are omitted from the string. For example, ``seconds`` of 67 becomes
    "1:07". A second example, ``seconds`` of 1472523 = 17\*24\*60\*60 +
    1\*60\*60 + 2\*60 + 3, results in the string "17+1:02:03".

:index:`evalInEachContext()<single: evalInEachContext(); ClassAd functions>`
:index:`evalInEachContext()<single: ClassAd functions; evalInEachContext()>`

``String evalInEachContext(Expression expr, List contexts)``
    This function evaluates its first argument as an expression in the context of
    each Classad in the second argument and returns a list that is the result of
    each evaluation. The first argument should be an expression. 
    If the second argument does not evaluate to a list of ClassAds, ``ERROR`` is returned.

    For example:

    .. code-block:: text

            {true, false} = evalInEachContext(Prio > 2, { [Prio=3;], [Prio=1;] })
            {3, 1} = evalInEachContext(Prio, { [Prio=3;], [Prio=1;] })
            ERROR = evalInEachContext(Prio > 2, { [Prio=3;], UNDEFINED })
            ERROR = evalInEachContext(Prio > 2, UNDEFINED)

:index:`countMatches()<single: countMatches(); ClassAd functions>`
:index:`countMatches()<single: ClassAd functions; countMatches()>`

``String countMatches(Expression expr, List contexts)``
    This function evaluates its first argument as an expression in the context of
    each Classad in the second argument and returns a count of the results that
    evaluated to ``True``. The first argument should be an expression. The second argument
    should be a list of ClassAds or a list of attribute references to classAds, or
    should evaluate to a list of ClassAds.  This function will always return a integer
    value when the first argument is defined and the second argument is not ``ERROR``.

    For example:

    .. code-block:: text

            1 = countMatches(Prio > 2, { [Prio=3;], [Prio=1;] })
            1 = countMatches(Prio > 2, { [Prio=3;], UNDEFINED })
            0 = countMatches(Prio > 2, UNDEFINED)


:index:`debug()<single: debug(); ClassAd functions>`
:index:`debug()<single: ClassAd functions; debug()>`

``AnyType debug(AnyType expression)``
    This function evaluates its argument, and it returns the result.
    Thus, it is a no-operation. However, a side-effect of the function
    is that information about the evaluation is logged to the evaluating
    program's log file, at the ``D_FULLDEBUG`` debug level. This is
    useful for determining why a given ClassAd expression is evaluating
    the way it does. For example, if a *condor_startd* :macro:`START`
    expression is unexpectedly evaluating to ``UNDEFINED``, then
    wrapping the expression in this debug() function will log
    information about each component of the expression to the log file,
    making it easier to understand the expression.
    
:index:`envV1ToV2()<single: envV1ToV2(); ClassAd functions>`
:index:`envV1ToV2()<single: ClassAd functions; envV1ToV2()>`

``String envV1ToV2(String old_env)``
    This function converts a set of environment variables from the old
    HTCondor syntax to the new syntax. The single argument should
    evaluate to a string that represents a set of environment variables
    using the old HTCondor syntax (usually stored in the job ClassAd
    attribute :ad-attr:`Env`). The result is the same set of environment
    variables using the new HTCondor syntax (usually stored in the job
    ClassAd attribute :ad-attr:`Environment`). If the argument evaluates to
    ``UNDEFINED``, then the result is also ``UNDEFINED``.
    
:index:`mergeEnvironment()<single: mergeEnvironment(); ClassAd functions>`
:index:`mergeEnvironment()<single: ClassAd functions; mergeEnvironment()>`

``String mergeEnvironment(String env1 [ , String env2, ... ])``
    This function merges multiple sets of environment variables into a
    single set. If multiple arguments include the same variable, the one
    that appears last in the argument list is used. Each argument should
    evaluate to a string which represents a set of environment variables
    using the new HTCondor syntax or ``UNDEFINED``, which is treated
    like an empty string. The result is a string that represents the
    merged set of environment variables using the new HTCondor syntax
    (suitable for use as the value of the job ClassAd attribute
    :ad-attr:`Environment`).

For the following functions, a delimiter is represented by a string.
Each character within the delimiter string delimits individual strings
within a list of strings that is given by a single string. The default
delimiter contains the comma and space characters. A string within the
list is ended (delimited) by one or more characters within the delimiter
string. 

:index:`stringListSize()<single: stringListSize(); ClassAd functions>`
:index:`stringListSize()<single: ClassAd functions; stringListSize()>`

``Integer stringListSize(String list [ , String delimiter ])``
    Returns the number of elements in the string ``list``, as delimited
    by the optional ``delimiter`` string. Returns ``ERROR`` if either
    argument is not a string.

    This function returns ``ERROR`` if other than 1 or 2 arguments are
    given. 

:index:`stringListSum()<single: stringListSum(); ClassAd functions>`
:index:`stringListSum()<single: ClassAd functions; stringListSum()>`

``Integer stringListSum(String list [ , String delimiter ])`` OR ``Real stringListSum(String list [ , String delimiter ])``
    Sums and returns the sum of all items in the string ``list``, as
    delimited by the optional ``delimiter`` string. If all items in the
    list are integers, the return value is also an integer. If any item
    in the list is a real value (noninteger), the return value is a
    real. If any item does not represent an integer or real value, the
    return value is ``ERROR``.
    
:index:`stringListAvg()<single: stringListAvg(); ClassAd functions>`
:index:`stringListAvg()<single: ClassAd functions; stringListAvg()>`

``Real stringListAvg(String list [ , String delimiter ])``
    Sums and returns the real-valued average of all items in the string
    ``list``, as delimited by the optional ``delimiter`` string. If any
    item does not represent an integer or real value, the return value
    is ``ERROR``. A list with 0 items (the empty list) returns the value
    0.0. 

:index:`stringListMin()<single: stringListMin(); ClassAd functions>`
:index:`stringListMin()<single: ClassAd functions; stringListMin()>`

``Integer stringListMin(String list [ , String delimiter ])`` OR ``Real stringListMin(String list [ , String delimiter ])``
    Finds and returns the minimum value from all items in the string
    ``list``, as delimited by the optional ``delimiter`` string. If all
    items in the list are integers, the return value is also an integer.
    If any item in the list is a real value (noninteger), the return
    value is a real. If any item does not represent an integer or real
    value, the return value is ``ERROR``. A list with 0 items (the empty
    list) returns the value ``UNDEFINED``.
    
:index:`stringListMax()<single: stringListMax(); ClassAd functions>`
:index:`stringListMax()<single: ClassAd functions; stringListMax()>`

``Integer stringListMax(String list [ , String delimiter ])`` OR ``Real stringListMax(String list [ , String delimiter ])``
    Finds and returns the maximum value from all items in the string
    ``list``, as delimited by the optional ``delimiter`` string. If all
    items in the list are integers, the return value is also an integer.
    If any item in the list is a real value (noninteger), the return
    value is a real. If any item does not represent an integer or real
    value, the return value is ``ERROR``. A list with 0 items (the empty
    list) returns the value ``UNDEFINED``.
    
:index:`stringListMember()<single: stringListMember(); ClassAd functions>`
:index:`stringListMember()<single: ClassAd functions; stringListMember()>`

``Boolean stringListMember(String x, String list [ , String delimiter ])``
    Returns ``TRUE`` if item ``x`` is in the string ``list``, as
    delimited by the optional ``delimiter`` string. Returns ``FALSE`` if
    item ``x`` is not in the string ``list``. Comparison is done with
    ``strcmp()``. The return value is ``ERROR``, if any of the arguments
    are not strings.
    
:index:`stringListIMember()<single: stringListIMember(); ClassAd functions>`
:index:`stringListIMember()<single: ClassAd functions; stringListIMember()>`

``Boolean stringListIMember(String x, String list [ , String delimiter ])``
    Same as ``stringListMember()``, but comparison is done with
    ``stricmp()``, so letter case is not relevant.
    
:index:`stringListIntersect()<single: stringListIntersect(); ClassAd functions>`
:index:`stringListIntersect()<single: ClassAd functions; stringListIntersect()>`

``Integer stringListsIntersect(String list1, String list2 [ , String delimiter ])``
    Returns ``TRUE`` if the lists contain any matching elements, and
    returns ``FALSE`` if the lists do not contain any matching elements.
    Returns ``ERROR`` if either argument is not a string or if an
    incorrect number of arguments are given.

:index:`stringListSubsetMatch()<single: stringListSubsetMatch(); ClassAd functions>`
:index:`stringListSubsetMatch()<single: ClassAd functions; stringListSubsetMatch()>`

``Boolean stringListSubsetMatch(String list1, String list2 [ , String delimiter ])``
    Returns ``TRUE`` if all item in the string ``list1`` are also in the string ``list2``, as
    delimited by the optional ``delimiter`` string.  Returns ``FALSE`` if
    ``list1`` has any items that are not in ``list2``. Both lists are treated as sets. Empty items
    and duplicate items are ignored. The return value is ``TRUE`` if ``list1`` is ``UNDEFINED`` or empty
    and ``list2`` is any string value.  The return value is ``FALSE`` if ``list1`` is any string value and ``list2`` is
    ``UNDEFINED``.  The return value is ``UNDEFINED`` if both ``list1`` and ``list2`` are ``UNDEFINED``.
    The return value is ``ERROR``, if any of the arguments are not either strings or ``UNDEFINED``

:index:`stringListISubsetMatch()<single: stringListISubsetMatch(); ClassAd functions>`
:index:`stringListISubsetMatch()<single: ClassAd functions; stringListISubsetMatch()>`

``Boolean stringListISubsetMatch(String list1, String list2 [ , String delimiter ])``
    Same as ``stringListSubsetMatch()``, but the sets are case-insensitive.


The following six functions utilize regular expressions as defined and
supported by the PCRE library. See
`http://www.pcre.org <http://www.pcre.org>`_ for complete documentation
of regular expressions.

The ``options`` argument to these functions is a string of special
characters that modify the use of the regular expressions. Inclusion of
characters other than these as options are ignored.

``I`` or ``i``
    Ignore letter case.

``M`` or ``m``
    Modifies the interpretation of the caret (^) and dollar sign ($)
    characters. The caret character matches the start of a string, as
    well as after each newline character. The dollar sign character
    matches before a newline character.

``S`` or ``s``
    The period matches any character, including the newline character.

``F`` or ``f``
    When doing substitution, return the full target string with
    substitutions applied. Normally, only the substitute text is
    returned.

``G`` or ``g``
    When doing substitution, apply the substitution for every matching
    portion of the target string (that doesn't overlap a previous
    match).

:index:`regexp()<single: regexp(); ClassAd functions>`
:index:`regexp()<single: ClassAd functions; regexp()>`

``Boolean regexp(String pattern, String target [ , String options ])``
    Uses the regular expression given by string ``pattern`` to scan
    through the string ``target``. Returns ``TRUE`` when ``target``
    matches the regular expression given by ``pattern``. Returns
    ``FALSE`` otherwise. If any argument is not a string, or if
    ``pattern`` does not describe a valid regular expression, returns
    ``ERROR``. 

:index:`regexpMember()<single: regexpMember(); ClassAd functions>`
:index:`regexpMember()<single: ClassAd functions; regexpMember()>`

``Boolean regexpMember(String pattern, List targetStrings [ , String options ])``
    Uses the description of a regular expression given by string ``pattern``
    to scan through a List of string n ``targetStrings``. Returns ``TRUE`` when ``target``
    matches a regular expression given by ``pattern``. If no strings match,
    and at least one item in targetString evaluated to undefined, returns
    undefined.  If any item in targetString before a match evaluated to neither
    a string nor undefined, returns ``ERROR``. 

:index:`regexps()<single: regexps(); ClassAd functions>`
:index:`regexps()<single: ClassAd functions; regexps()>`

``String regexps``
    ``(String pattern, String target, String substitute [ , String options ])``
    Uses the regular expression given by string ``pattern`` to scan
    through the string ``target``. When ``target`` matches the regular
    expression given by ``pattern``, the string ``substitute`` is
    returned, with backslash expansion performed. If any argument is not
    a string, returns ``ERROR``.
    :index:`replace()<single: replace(); ClassAd functions>`

:index:`replace()<single: replace(); ClassAd functions>`
:index:`replace()<single: ClassAd functions; replace()>`

``String replace``
    ``(String pattern, String target, String substitute [ , String options ])``
    Uses the regular expression given by string ``pattern`` to scan
    through the string ``target``. Returns a modified version of
    ``target``, where the first substring that matches ``pattern`` is
    replaced by the string ``substitute``, with backslash expansion
    performed. Equivalent to ``regexps()`` with the ``f`` option. If any
    argument is not a string, returns ``ERROR``.
    :index:`replaceall()<single: replaceall(); ClassAd functions>`

:index:`replaceall()<single: replaceall(); ClassAd functions>`
:index:`replaceall()<single: ClassAd functions; replaceall()>`

``String replaceall``
    ``(String pattern, String target, String substitute [ , String options ])``
    Uses the regular expression given by string ``pattern`` to scan
    through the string ``target``. Returns a modified version of
    ``target``, where every substring that matches ``pattern`` is
    replaced by the string ``substitute``, with backslash expansion
    performed. Equivalent to ``regexps()`` with the ``fg`` options. If
    any argument is not a string, returns ``ERROR``.

:index:`stringList_regexpMember()<single: stringList_regexpMember(); ClassAd functions>`
:index:`stringList_regexpMember()<single: ClassAd functions; stringList_regexpMember()>`

``Boolean stringList_regexpMember``
    ``(String pattern, String list [ , String delimiter ] [ , String options ])``
    Uses the description of a regular expression given by string
    ``pattern`` to scan through the list of strings in ``list``. Returns
    ``TRUE`` when one of the strings in ``list`` is a regular expression
    as described by ``pattern``. The optional ``delimiter`` describes
    how the list is delimited, and string ``options`` modifies how the
    match is performed. Returns ``FALSE`` if ``pattern`` does not match
    any entries in ``list``. The return value is ``ERROR``, if any of
    the arguments are not strings, or if ``pattern`` is not a valid
    regular expression. 

:index:`userHome()<single: userHome(); ClassAd functions>`
:index:`userHome()<single: ClassAd functions; userHome()>`

``String userHome(String userName [ , String default ])``
    Returns the home directory of the given user as configured on the
    current system (determined using the getpwdnam() call). (Returns
    ``default`` if the ``default`` argument is passed and the home
    directory of the user is not defined.)
    
:index:`userMap()<single: userMap(); ClassAd functions>`
:index:`userMap()<single: ClassAd functions; userMap()>`

``List userMap(String mapSetName, String userName)``
    Map an input string using the given mapping set. Returns a string containing
    the list of groups to which the user belongs separated by commas or undefined
    if the user was not found in the map file.
    
``String userMap(String mapSetName, String userName, String preferredGroup)``
    Map an input string using the given mapping set. Returns a string,
    which is the preferred group if the user is in that group; otherwise
    it is the first group to which the user belongs, or undefined if the
    user belongs to no groups.
    
    :index:`userMap()<single: userMap(); ClassAd functions>`

``String userMap(String mapSetName, String userName, String preferredGroup, String defaultGroup)``
    Map an input string using the given mapping set. Returns a string,
    which is the preferred group if the user is in that group; the first
    group to which the user belongs, if any; and the default group if
    the user belongs to no groups.

    The maps for the ``userMap()`` function are defined by the following
    configuration macros: :macro:`<SUBSYS>_CLASSAD_USER_MAP_NAMES`,
    :macro:`CLASSAD_USER_MAPFILE_<name>` and :macro:`CLASSAD_USER_MAPDATA_<name>`
    (see the :ref:`admin-manual/configuration-macros:htcondor-wide
    configuration file entries` section).